简体   繁体   中英

Python usersite directory points to file that doesn't exist

I have downloaded and installed python modules before with no problem. Recently, however, none of the modules(They did install correctly) I have installed have been importable.

The modules installed where I expected them to - C:\\Python27\\lib\\site-packages, and I have a .pth file created in that directory that points to each of the packages I want to be able to import.

The problem is that my site directory points to a file that doesn't exist: C:\\Users\\cam\\AppData\\Roaming\\Python\\Python27\\site-packages

By including the code

import site
site.addsitedir("C:\Python27\lib\site-packages")

However, I'd much rather just modify my site directories to point to that directory as well. I've looked around but have not found any way to do this. Any suggestions?

将PYTHONPATH添加为系统变量,并将所有所需的路径添加为该变量的值

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