简体   繁体   中英

Python virtualenv has changed sys.path permanently

I have activated a python virtualenv (dev) for one of my projects. However, don't know what happened, it looks like it has changed the path permanently. I cannot access my global packages. When I print sys.path it shows me paths related to virtualenv (dev) which is no more activated. When I run pip list, it shows me packages installed for virtualenv (dev) and not the ones install globally (c:\\python27\\Lib\\sitepackages). Any idea what must have gone wrong? And how do I reset sys.path?

I checked out RegistryKey (HKEY_LOCAL_MACHINE\\SOFTWARE\\Python\\PythonCore\\2.7\\PythonPath) and Environment variables, everything looks okay. Any light on this issue would be helpful...

Your default environment variables may be wrong in path, since the default path must point to the python globally.

Try this:

  1. Start menu > Run > 'sysdm.cpl' > Enter
  2. Search for the tab 'Advanced'
  3. Finally 'Environment Variables'

Edit the system variable ' Path '

Carefully and search for the python path, just change it to the global paths instead.

c:\\python27\\Lib\\site-packages\\PyQT4 (usually) c:\\python27 c:\\python27\\scripts

Hope I could help.

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