如何导入已经安装的Python模块“ Bitstring”
我在Windows上,从克隆的GitHub存储库中处理Python文件。尝试这样做时,
import bitstring as bs
我会收到此错误:
ModuleNotFoundError: No module named 'bitstring'
但是“ PIP列表”显示了它。
我试图卸载并重新安装它,然后可以使用 pip install bitstring 安装它。问题与导入模块有关。
它的位置为 d:\ program \ anaconda \ lib \ lib \ site-packages ,与numpy相同,我可以毫无问题地导入。
使用 python -m pip安装bittring 在写作时不起作用
:
import sys
for p in sys.path:
print(p)
我看到与在终端中键入时相同的位置:
pip show bitstring
我还向环境变量添加了PIP路径,但是问题仍然存在遗迹。
通过编写以下内容,代码运行,但是模块名称仍然被强调为“ NotFound”,并且调试给出了错误。
import sys
sys.path.append(r'd:\\programs\\anaconda\\lib\site-packages')
I'm on Windows and working on a python file from a cloned gitHub repository. When trying to do
import bitstring as bs
I get this error:
ModuleNotFoundError: No module named 'bitstring'
But "pip list" shows it.
I tried to uninstall and reinstall it and I can install it just fine with pip install bitstring. The problem is related to importing the module.
Its location is d:\programs\anaconda\lib\site-packages , same as numpy, which I can import without problems.
Installing it with python -m pip install bitstring doesn't work
When writing:
import sys
for p in sys.path:
print(p)
I see the same location as when typing in the terminal:
pip show bitstring
I also added the pip path to the environment variables, but the problem still remains.
By writing the following, the code runs, but the module name still remains highlighted as "NotFound", and the debugging gives an error.
import sys
sys.path.append(r'd:\\programs\\anaconda\\lib\site-packages')
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论