anaconda 虚拟环境 pip遇到问题
之前从来没有遇到过这个问题 今天想用pip突然发现不对劲
C:\Users\hugo.villalobos>pip install django-admin-tools Could not import runpy module Traceback (most recent call last): File "C:\Python34\Lib\runpy.py", line 14, in <module> import importlib.machinery # importlib first so we can test #15386 via -m File "C:\Python34\Lib\importlib\__init__.py", line 34, in <module> _w_long = _bootstrap._w_long AttributeError: module 'importlib._bootstrap' has no attribute '_w_long'
解决方法是在写一个用户环境变量PYTHONPATH
如下:
<Anaconda安装路径>\Scripts;<Anaconda安装路径>
参考这个
https://stackoverflow.com/questions/46509441/module-importlib-bootstrap-has-no-attribute-w-long
还有一个报错
我的anaconda环境出了问题 我在我的anaconda 虚拟环境中运行pip 结果出现这个问题
93916 ~ frida 3.8.19 pip list 16:11:30 羽974ms
Error processing line 1 of E:\Anaconda3\lib\site-packages\matplotlib-3.0.3-py3.7-nspkg.pth:
Traceback (most recent call last):
File “E:\Anaconda3\lib\site.py”, line 168, in addpackage
exec(line)
File “”, line 1, in
File “E:\Anaconda3\lib\importlib_init_.py”, line 51, in
_w_long = _bootstrap_external._w_long
AttributeError: module ‘importlib._bootstrap_external’ has no attribute ‘_w_long’
Remainder of file ignored
Error processing line 1 of E:\Anaconda3\lib\site-packages\sphinxcontrib_websupport-1.2.4-py3.7-nspkg.pth:
Traceback (most recent call last):
File “E:\Anaconda3\lib\site.py”, line 168, in addpackage
exec(line)
File “”, line 1, in
File “E:\Anaconda3\lib\importlib_init_.py”, line 51, in
_w_long = _bootstrap_external._w_long
AttributeError: module ‘importlib._bootstrap_external’ has no attribute ‘_w_long’
Remainder of file ignored
Error processing line 1 of E:\Anaconda3\lib\site-packages\zope.interface-5.4.0-py3.7-nspkg.pth:
Traceback (most recent call last):
File “E:\Anaconda3\lib\site.py”, line 168, in addpackage
exec(line)
File “”, line 1, in
File “E:\Anaconda3\lib\importlib_init_.py”, line 51, in
_w_long = _bootstrap_external._w_long
AttributeError: module ‘importlib._bootstrap_external’ has no attribute ‘_w_long’
把这几个pth文件删了就行
关于.pth文件
.pth文件可以影响Python的导入机制,让Python在启动时执行特定的路径添加操作。如果这些.pth文件包含指向错误或不兼容版本的Python库的路径,就可能出现你所遇到的错误。