简体   繁体   中英

psycopg2 unable to install in pycharm

I have been trying to install psycopg2 in pycharm but I am unable to do so. I read few posts and they all talked about stickpeople psycopg2 installer for which link doesnt seem to work. 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

Try deleting that temporary directory first

Then try installing it using 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.
I successfully installed it by:
File -> Settings -> Project Interpreter -> Clicked + -> Search , then added the psycopg2 package there.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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