I would like to use conda to create different environments, each with a different $PYTHONPATH. Currently, I have to change the environment variables each time in my .bashrc. Is there a simple way of creating multiple python environments via conda, such that I can seamless switch (via source activate) and have the corresponding $PYTHONPATHs update automatically?
相关问题
- how to define constructor for Python's new Nam
- streaming md5sum of contents of a large remote tar
- How to get the background from multiple images by
- Django __str__ returned non-string (type NoneType)
- Evil ctypes hack in python
$PYTHONPATH can be changed when a conda environment is activated or deactivated, the same way it can be done with other environment variables. The following section in condo documentation describes how to specify this behaviour: Saved environment variables.
For example, you can add the following line to the activation script
and so on ...
You can specify the PYTHONPATH before you execute any script, which would be easier than changing your .bashrc
For example, to put the current working directory on the path before executing any script, you can do this
If you didn't want to overwrite the entire path, but just append to it