Python 3.5。2.
Ubuntu 16.04 LTS
尝试使用pip3安装某些软件包时,无论参数如何,它都会返回以下结果:
Traceback (most recent call last):
File "/usr/lib/python3/dist-packages/pip/_vendor/__init__.py", line 33, in vendored
__import__(vendored_name, globals(), locals(), level=0)
ImportError: No module named 'pip._vendor.pkg_resources'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/usr/bin/pip3", line 9, in <module>
from pip import main
File "/usr/lib/python3/dist-packages/pip/__init__.py", line 13, in <module>
from pip.exceptions import InstallationError, CommandError, PipError
File "/usr/lib/python3/dist-packages/pip/exceptions.py", line 6, in <module>
from pip._vendor.six import iteritems
File "/usr/lib/python3/dist-packages/pip/_vendor/__init__.py", line 75, in <module>
vendored("pkg_resources")
File "/usr/lib/python3/dist-packages/pip/_vendor/__init__.py", line 36, in vendored
__import__(modulename, globals(), locals(), level=0)
File "<frozen importlib._bootstrap>", line 969, in _find_and_load
File "<frozen importlib._bootstrap>", line 958, in _find_and_load_unlocked
File "<frozen importlib._bootstrap>", line 664, in _load_unlocked
File "<frozen importlib._bootstrap>", line 634, in _load_backward_compatible
File "/usr/share/python-wheels/pkg_resources-0.0.0-py2.py3-none-any.whl/pkg_resources/__init__.py", line 2927, in <module>
File "/usr/share/python-wheels/pkg_resources-0.0.0-py2.py3-none-any.whl/pkg_resources/__init__.py", line 2913, in _call_aside
File "/usr/share/python-wheels/pkg_resources-0.0.0-py2.py3-none-any.whl/pkg_resources/__init__.py", line 2952, in _initialize_master_working_set
File "/usr/share/python-wheels/pkg_resources-0.0.0-py2.py3-none-any.whl/pkg_resources/__init__.py", line 956, in subscribe
File "/usr/share/python-wheels/pkg_resources-0.0.0-py2.py3-none-any.whl/pkg_resources/__init__.py", line 2952, in <lambda>
File "/usr/share/python-wheels/pkg_resources-0.0.0-py2.py3-none-any.whl/pkg_resources/__init__.py", line 2515, in activate
File "/usr/share/python-wheels/pkg_resources-0.0.0-py2.py3-none-any.whl/pkg_resources/__init__.py", line 2097, in declare_namespace
File "/usr/share/python-wheels/pkg_resources-0.0.0-py2.py3-none-any.whl/pkg_resources/__init__.py", line 2047, in _handle_ns
File "/usr/share/python-wheels/pkg_resources-0.0.0-py2.py3-none-any.whl/pkg_resources/__init__.py", line 2066, in _rebuild_mod_path
AttributeError: '_NamespacePath' object has no attribute 'sort'
我试图通过以下方式重新安装python3 pip来修复它:
sudo apt install --reinstall python3-pip
但那没有帮助。
我发现它与我安装的软件包有关,这些软件包是用ls/usr/lib/python3/dist软件包生成的:
alabaster
alabaster-0.7.7.egg-info
apport
apport_python_hook.py
apt
aptdaemon
apt_inst.cpython-35m-x86_64-linux-gnu.so
apt_pkg.cpython-35m-x86_64-linux-gnu.so
aptsources
AptUrl
apturl-0.5.2.egg-info
babel
Babel-1.3.egg-info
beautifulsoup4-4.4.1.egg-info
blinker
blinker-1.3.egg-info
Brlapi-0.6.4.egg-info
brlapi.cpython-35m-x86_64-linux-gnu.so
bs4
cairo
_cffi_backend.cpython-35m-x86_64-linux-gnu.so
chardet
chardet-2.3.0.egg-info
checkbox_support
checkbox_support-0.22.egg-info
CommandNotFound
command_not_found-0.3.egg-info
cryptography
cryptography-1.2.3.egg-info
cups.cpython-35m-x86_64-linux-gnu.so
cupsext.cpython-35m-x86_64-linux-gnu.so
cupshelpers
curl
cycler-0.9.0.egg-info
cycler.py
dateutil
dbus
_dbus_bindings.cpython-35m-x86_64-linux-gnu.so
_dbus_glib_bindings.cpython-35m-x86_64-linux-gnu.so
deb822.py
debconf.py
debian
debian_bundle
decorator-4.0.6.egg-info
decorator.py
defer
defer-1.0.6.egg-info
DistUpgrade
docutils
docutils-0.12.egg-info
easy_install.py
feedparser-5.1.3.egg-info
feedparser.py
feedparser_sgmllib3.py
gi
guacamole
guacamole-0.9.2.egg-info
hpmudext.cpython-35m-x86_64-linux-gnu.so
html5lib
html5lib-0.999.egg-info
httplib2
httplib2-0.9.1.egg-info
idna
idna-2.0.egg-info
IPython
ipython-2.4.1.egg-info
janitor
jedi
jedi-0.9.0.egg-info
jinja2
Jinja2-2.8.egg-info
jwt
LanguageSelector
language_selector-0.1.egg-info
language_support_pkgs.py
louis
louis-2.6.4.egg-info
lsb_release.py
lxml
lxml-3.5.0.egg-info
mako
Mako-1.0.3.egg-info
markupsafe
MarkupSafe-0.23.egg-info
matplotlib
matplotlib-1.5.1.egg-info
matplotlib-1.5.1-nspkg.pth
mpl_toolkits
numexpr
numexpr-2.4.3.egg-info
numpy
numpy-1.11.0.egg-info
NvidiaDetector
oauthlib
oauthlib-1.0.3.egg-info
Onboard
onboard-1.2.0.egg-info
orca
padme
padme-1.1.1.egg-info
pandas
pandas-0.17.1.egg-info
pcardext.cpython-35m-x86_64-linux-gnu.so
pep8-1.7.0.egg-info
pep8.py
pexpect
pexpect-4.0.1.egg-info
PIL
Pillow-3.1.2.egg-info
pip
pip-8.1.1.egg-info
pkg_resources
plainbox
plainbox-0.25.egg-info
ply
ply-3.7.egg-info
problem_report.py
psutil
psutil-3.4.2.egg-info
ptyprocess
ptyprocess-0.5.egg-info
pyasn1
pyasn1-0.1.9.egg-info
pyatspi
__pycache__
pycups-1.9.73.egg-info
pycurl-7.43.0.egg-info
pycurl.cpython-35m-x86_64-linux-gnu.so
pyflakes
pyflakes-1.1.0.egg-info
pygments
Pygments-2.1.egg-info
pygobject-3.20.0.egg-info
pygtkcompat
PyJWT-1.3.0.egg-info
pylab.py
pyparsing-2.0.3.egg-info
pyparsing.py
PyQt4
python_apt-1.1.0.b1_ubuntu0.16.04.1.egg-info
python_dateutil-2.4.2.egg-info
python_debian-0.1.27.egg-info
python_systemd-231.egg-info
pytz
pytz-2014.10.egg-info
pyxdg-0.25.egg-info
pyzmq-15.2.0.egg-info
Quirks
reportlab
reportlab-3.3.0.egg-info
requests
requests-2.9.1.egg-info
roman-2.0.0.egg-info
roman.py
scanext.cpython-35m-x86_64-linux-gnu.so
scipy
scipy-0.17.0.egg-info
sessioninstaller
sessioninstaller-0.0.0.egg-info
setuptools
setuptools-20.7.0.egg-info
simplegeneric-0.8.1.egg-info
simplegeneric.py
sipconfig_nd5.py
sipconfig.py
sip.cpython-35m-x86_64-linux-gnu.so
six-1.10.0.egg-info
six.py
softwareproperties
speechd
speechd_config
sphinx
Sphinx-1.3.6.egg-info
sphinx_rtd_theme
sphinx_rtd_theme-0.1.9.egg-info
spyder-2.3.8.egg-info
spyderlib
spyderplugins
systemd
system_service-0.3.egg-info
tables
tables-3.2.2.egg-info
UbuntuDrivers
ubuntu_drivers_common-0.0.0.egg-info
UbuntuSystemService
ufw
ufw-0.35.egg-info
unattended_upgrades-0.1.egg-info
unity_scope_calculator-0.1.egg-info
unity_scope_chromiumbookmarks-0.1.egg-info
unity_scope_colourlovers-0.1.egg-info
unity_scope_devhelp-0.1.egg-info
unity_scope_firefoxbookmarks-0.1.egg-info
unity_scope_gdrive-0.7.egg-info
unity_scope_manpages-0.1.egg-info
unity_scope_openclipart-0.1.egg-info
unity_scope_texdoc-0.1.egg-info
unity_scope_tomboy-0.1.egg-info
unity_scope_virtualbox-0.1.egg-info
unity_scope_yelp-0.1.egg-info
unity_scope_zotero-0.1.egg-info
unohelper.py
uno.py
UpdateManager
urllib3
urllib3-1.13.1.egg-info
usbcreator
usb_creator-0.3.0.egg-info
wheel
wheel-0.29.0.egg-info
xdg
xdiagnose
xdiagnose-3.8.4.1.egg-info
xkit
xkit-0.0.0.egg-info
xlsxwriter
XlsxWriter-0.7.3.egg-info
zmq
我不完全确定错误是从哪里来的。
我面临着类似的问题。这似乎与bug#4330和#4216有关。在这两个链接中,不同的人提到了对他们有效的解决方案。根据后一个链接上发布的建议,修复我的问题的命令是:
rm ~/.local/lib/python3.5/site-packages/matplotlib* -rf
尝试:
python -m pip install --upgrade setuptools
尝试sudoapt安装重新安装python3-pkg资源python3-setupols
。虽然pkg_resources
通常包含在setupols
中,但是那些来自Debian和Ubuntu的家伙为它维护了一个单独的包。
如果没有帮助,请尝试以下命令在主目录中设置更新的setuptools
(包括pkg\u资源
):
mkdir upgrade-setuptools
cd upgrade-setuptools
cat > usercustomize.py <<EOF
try:
import setuptools
except ImportError:
import setuptools
pip3 install --user -U setuptools pip
cd ..
rm upgrade-setuptools/usercustomize.py
rmdir upgrade-setuptools
根据https://github.com/pypa/setuptools/issues/885#issuecomment-266583177,导入setuptools
两次应该可以解决此问题。
当我在1到9之间选择一个数字并在控制台中输入一个数字时,该方法会工作并进行正确的移动。但我的问题是如何避免当我输入一个字母而不是一个数字时,程序就崩溃了。
应用程序由于stacktrace的StackOverflow错误而不时崩溃(见下文)。 该错误意外地出现在各种方案中。我们无法模拟它或预测它的发生。 提前谢谢你。 Stacktrace错误(缩短版):
在我的应用程序主页中,auto complete在对话框栏内的按钮上打开,该位置用于搜索查询。问题是,当我尝试通过再次按下按钮来更改位置时,应用程序崩溃,出现以下错误。 这是按钮按活动及其调用的方法。 下面是xml代码 以下是logcat 我已经研究了很多问题,几乎所有的答案都是在中添加一些代码行,而我没有这些代码行。在第一次点击片断的时候,问题是当我再次按下按钮来改变应用程序完全粉碎的位置。欢迎
我正试着用这本手册开始tensorflowhttps://www.tensorflow.org/install/install_windows 所有安装都成功完成,我正在使用python 3.5.2和最新版本的pip,遇到这个错误,有人告诉我应该怎么做吗? 在swig\parth\AppData\Local\Programs\Python35\lib\site-p tensorflow\Pytho
注意:我的问题被关闭之前,我尝试了这里提到的解决方案-未知错误:会话删除,因为页面崩溃从未知错误:无法确定加载状态从标签崩溃与ChromeDriver硒-添加这些选项-options.add参数("--disable-dev-shm-用法");options.add参数("--no-沙盒"); -- 我仍然看到的问题 在selenium网格中运行时,在某些情况下,单个测试会出现以下错误: 方法1:
我正在尝试将java项目导入到eclipse(4.8.0),它显示了以下API的导入错误。 显示的错误为: 命令提示符中的PFB JDK和JRE版本: