英文:
Unable to Install Any Libraries Using pip in Python 3.5.2 Environment on Windows 11
问题
你好,Stack Overflow 社区。
我目前正在处理一个从GitHub克隆的项目,需要Python 3.5.2,Keras 2.1.5和TensorFlow 1.6.0。我正在运行这个项目在Windows 11上。为了适应这个需求,我已经创建了一个新的Python 3.5.2环境并激活了它。
然而,当我尝试使用pip安装任何库时,操作无法完成。无论是Keras、TensorFlow还是其他任何包,控制台都会响应“Collecting [package_name]”,但似乎不会下载或安装库。
例如,当我运行以下命令时:
pip install keras==2.1.5
pip install tensorflow==1.6.0
控制台输出“Collecting keras==2.1.5”和“Collecting tensorflow==1.6.0”,但没有进一步的更新,包也没有被安装。
我尝试搜索类似的问题并尝试在这个环境中重新安装pip,但迄今为止,似乎没有解决方案有效。
有人可以帮助我理解出了什么问题以及如何解决吗?
提前谢谢!
英文:
Hello Stack Overflow Community.
I am currently working with a project cloned from GitHub which requires Python 3.5.2, Keras 2.1.5 and TensorFlow 1.6.0. I'm running this on a Windows 11 machine. To accommodate this, I've created a new Python 3.5.2 environment and activated it.
However, when I try to install any library using pip, the operation does not complete. Whether it's Keras, TensorFlow, or any other package, the console responds with "Collecting [package_name]" but doesn't seem to download or install the library.
For instance, when I run these commands:
pip install keras==2.1.5
pip install tensorflow==1.6.0
The console outputs "Collecting keras==2.1.5" and "Collecting tensorflow==1.6.0", but there are no further updates, and the packages don't get installed.
I've tried searching for similar issues and have attempted to reinstall pip in this environment, but so far, no solution seems to work.
Could anyone help me understand what's going wrong and how I might resolve it?
Thank you in advance!
答案1
得分: 1
尝试这个:
python -m pip install SomePackage==1.0.4
# 指定版本
当使用 -m pip
时,你在告诉 Python 以主模块方式运行 pip。由于它不是一个命令行操作,Python 可能无法识别 pip 作为你要运行的内容。
英文:
Try this:
python -m pip install SomePackage==1.0.4
# specific version
When using -m pip
, you are telling Python to run pip as the main module. Python likely is not recognizing pip as what you want it to run, since it is not a command-line operation.
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论