简体   繁体   English

psycopg2 无法在 pycharm 中安装

[英]psycopg2 unable to install in pycharm

I have been trying to install psycopg2 in pycharm but I am unable to do so.我一直在尝试在 pycharm 中安装 psycopg2,但我无法这样做。 I read few posts and they all talked about stickpeople psycopg2 installer for which link doesnt seem to work.我读了几篇文章,他们都谈到了stickpeople psycopg2 安装程序,其中的链接似乎不起作用。 this is the error message I get这是我收到的错误信息

Downloading/unpacking psycopg2==2.4.5
Cleaning up...
Exception:
Traceback (most recent call last):
 File "C:\Python27\lib\site-packages\pip\basecommand.py", line 122, in main
   status = self.run(options, args)
 File "C:\Python27\lib\site-packages\pip\commands\install.py", line 278, in run
    requirement_set.prepare_files(finder, force_root_egg_info=self.bundle, bundle=self.bundle)
 File "C:\Python27\lib\site-packages\pip\req.py", line 1197, in prepare_files
    do_download,
 File "C:\Python27\lib\site-packages\pip\req.py", line 1375, in unpack_url
    self.session,`enter code here`
 File "C:\Python27\lib\site-packages\pip\download.py", line 591, in unpack_http_url
     os.rmdir(temp_dir)
 WindowsError: [Error 145] The directory is not empty:     'c:\\users\\501300~1\\appdata\\local\\temp\\pip-1_ogxi-unpack'

Pycharm has/had an issue with installing psycopg2 Pycharm 在安装 psycopg2 时遇到/遇到问题

Try deleting that temporary directory first尝试先删除该临时目录

Then try installing it using pip然后尝试使用 pip 安装它

pip install psycopg2==2.4.5

The other solutions did not work for me.其他解决方案对我不起作用。 When I tried to install psycopg2 using commands it gave a lot of errors.当我尝试使用命令安装psycopg2它给出了很多错误。
I successfully installed it by:我通过以下方式成功安装了它:
File -> Settings -> Project Interpreter -> Clicked + -> Search , then added the psycopg2 package there. File -> Settings -> Project Interpreter -> Clicked + -> Search ,然后在那里添加了psycopg2包。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM