User Tools

Site Tools


deptlab:python_virtual_env

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
deptlab:python_virtual_env [2022/03/28 02:11] – [Using Virtual Environments] localadmindeptlab:python_virtual_env [2024/09/17 17:18] (current) – [Using Virtual Environments] localadmin
Line 82: Line 82:
 Now your shell session is back to normal, and the python command refers to the global Python install. Remember to do this whenever you’re done using a specific virtual environment. Now your shell session is back to normal, and the python command refers to the global Python install. Remember to do this whenever you’re done using a specific virtual environment.
  
-===== Using a Python3 IDE with Virtual Environments =====+Using Virtual Environment makes it east to reset your Python environment if you need to use a different set of packages.  Just delete the old environment and create a new one.
  
-=== Spyder Method 1 (Doesn't work well with tensorflow) ===+**Be sure to cleanup/delete unused temp files and environments when done using them.**
  
 +===== Tips for Using a Python3 IDE with Virtual Environments =====
 +
 +==== Using Spyder in the 244 Lab ====
   - Activate (start) your virtual environment.   - Activate (start) your virtual environment.
-  - Run spyder from the environment (after source activate) +  - Run spyder  
-  - Go to Tools --> preferences --> python Interpreter and select the python file from the env you want to link to spyder ex : /home/you/envs/your_env/bin/python+  - Go to Tools --> preferences --> python Interpreter and select the python file from the virtual env you want to link to Spyder ex : /home/you/envs/your_env/bin/python
  
-=== Spyder Method (Use with tensorflow) ===+==== Preferred Method on Research Computers: Spyder Method (Use with tensorflow) ====
 To use Spyder.   To use Spyder.  
   - Activate (start) your virtual environment.   - Activate (start) your virtual environment.
 +  - Install the needed packages with pip
   - Install Spyder into your environment using pip install spyder.   - Install Spyder into your environment using pip install spyder.
   - Then start spyder from the environment command line with the command spyder.   - Then start spyder from the environment command line with the command spyder.
 +
 +==== Spyder Method 2 (Doesn't work well with tensorflow) ====
 +
 +  - Activate (start) your virtual environment.
 +  - Run spyder from the environment (after source activate)
 +  - Go to Tools --> preferences --> python Interpreter and select the python file from the env you want to link to spyder ex : /home/you/envs/your_env/bin/python
  
  
  [[https://realpython.com/python-virtual-environments-a-primer/|See... Using Python Virtual Environments]] for more detail  [[https://realpython.com/python-virtual-environments-a-primer/|See... Using Python Virtual Environments]] for more detail
deptlab/python_virtual_env.1648433518.txt.gz · Last modified: by localadmin