我一直在尝试在pycharm中安装psycopg2,但我无法这样做。我阅读了几篇帖子,他们都谈到了stickpeople psycopg2安装程序链接似乎不起作用。这是我收到的错误消息
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'
答案 0 :(得分:0)
Pycharm在安装psycopg2时遇到了问题
首先尝试删除该临时目录
然后尝试使用pip安装它 pip install psycopg2 == 2.4.5
答案 1 :(得分:-1)
其他解决方案对我不起作用。当我尝试使用命令安装psycopg2
时,出现了很多错误。
我通过以下方式成功安装了它:
File
-> Settings
-> Project Interpreter
->单击+
-> Search
,然后在其中添加psycopg2
软件包。