Python 无法在 Pycharm 中安装软件包
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/40060353/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Not able to install packages in Pycharm
提问by penta
I have pycharm community edition(latest stable build) installed on my Ubuntu 16.04 LTS, I am not able to install packages via pycharm, was able to install them before. I can install the packages via pip, but would like to solve this issue.
我在我的 Ubuntu 16.04 LTS 上安装了 pycharm 社区版(最新的稳定版本),我无法通过 pycharm 安装软件包,之前能够安装它们。我可以通过 pip 安装软件包,但想解决这个问题。
Below is the Screenshot of the problem
下面是问题截图
Have googled for this issue, but could not find any fix, I have a windows machine and it does not face the same issue.
用谷歌搜索过这个问题,但找不到任何解决办法,我有一台 Windows 机器,它没有遇到同样的问题。
采纳答案by penta
I have got a solution, i reffered to https://youtrack.jetbrains.com/issue/PY-20081#u=1468410176856.
我有一个解决方案,我参考了https://youtrack.jetbrains.com/issue/PY-20081#u=1468410176856。
Here they have tried to add https://pypi.python.org/pypias a repository.
在这里,他们尝试将https://pypi.python.org/pypi添加为存储库。
To add it as a repository,
要将其添加为存储库,
1.) Go to Settings
2.) Project interpreter
3.) Click the + sign on top right edge
4.) Go to manage repositories,
5.) Press the + Sign, then add https://pypi.python.org/pypi
6.) Press Ok
Now all the packages should load.
现在所有的包都应该加载。
Thanks Hami Torun & Simon, I was able to solve it by luck.
感谢 Hami Torun 和 Simon,我很幸运地解决了这个问题。
回答by Belloz
I had the same issue. It happened suddenly, day ago I was able to perform pip or install packages but on the next day error appeared. However this helped (I used version PyCharm Community Edition 2018):
我遇到过同样的问题。它突然发生,前一天我能够执行 pip 或安装软件包,但第二天出现错误。但是这有帮助(我使用了 PyCharm Community Edition 2018 版本):
Go to Settings -> Project Interpreter -> click green "+" icon (on right) -> Manage Repositories (on bottom) -> delete https://pypi.python.org/simple-> add https://pypi.python.org/pypithen click Ok. Repo will be back again as /simple, but don't worry, error should disappear and you should be able to install packages again.
转到设置 -> 项目解释器 -> 单击绿色“+”图标(右侧)-> 管理存储库(底部)-> 删除https://pypi.python.org/simple-> 添加https://pypi。 python.org/pypi然后单击确定。Repo 将再次作为 /simple 返回,但别担心,错误应该会消失,您应该能够再次安装软件包。
回答by saleh sereshki
For me, it was because of low space in my pc. After I free up space the problem solved. Pycharm did not say anything about this problem. It just shows that "the package installed successfully", but actually package was not installed.
对我来说,这是因为我的电脑空间不足。在我释放空间后,问题解决了。Pycharm 对这个问题没有说任何话。它只是显示“软件包安装成功”,但实际上并没有安装软件包。