Python Forum
using pyenv and virtual environment created with venv question
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
using pyenv and virtual environment created with venv question
#1
Ok,

I am running OpenSuse Leap 15

I have pyenv properly (I'm quite (sort of, maybe) confident of this) running, and set up to run python 3.7.0 when I execute python from shell.
I also have a virtual environment created with:
python -m venv flaskapp
I start (or so I thought) my virtual environment without error, using (from flaskapp directory):
./bin/activate
Then run Python and pip check:
arz60p@linux-nnem:/run/media/Larz60p/Data-4TB/python/e-h/f/flaskapp/app/tools> python -V
Python 3.7.0
Larz60p@linux-nnem:/run/media/Larz60p/Data-4TB/python/e-h/f/flaskapp/app/tools> pip -V
pip 10.0.1 from /home/Larz60p/.pyenv/versions/3.7.0/lib/python3.7/site-packages/pip (python 3.7)
and it doesn't appear to be running local copy

I then run this simple script:
# Check if in virtual environment
import sys

if hasattr(sys, 'real_prefix'):
    print('Running virtual environment')
else:
    print('Not running virtual environment')
and get reply:
Larz60p@linux-nnem:/run/media/Larz60p/Data-4TB/python/e-h/f/flaskapp/app/tools> python CheckEnvironment.py 
Not running virtual environment
Why?
Reply


Messages In This Thread
using pyenv and virtual environment created with venv question - by Larz60+ - Jul-04-2018, 09:49 AM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Help with creating folder and "virtual environment" AudunNilsen 1 249 Mar-21-2024, 04:41 AM
Last Post: deanhystad
  my venv is not loading njoki 1 261 Mar-20-2024, 10:41 AM
Last Post: snippsat
  Installing python packages in a virtual environment Led_Zeppelin 1 775 Aug-15-2023, 08:18 PM
Last Post: deanhystad
  Understanding venv; How do I ensure my python script uses the environment every time? Calab 1 2,291 May-10-2023, 02:13 PM
Last Post: Calab
  Problem with virtual environment standenman 2 1,014 Feb-23-2023, 07:09 PM
Last Post: standenman
  Python venv and PIP version issue JanOlvegg 2 1,279 Feb-22-2023, 02:22 AM
Last Post: JanOlvegg
Question Virtual Environment (using VS Code) Ashcora 4 14,133 Feb-15-2023, 07:17 PM
Last Post: snippsat
  Visual Studio Code venv ibm_db error mesi1000 7 2,833 Nov-13-2022, 12:36 AM
Last Post: snippsat
  How do I link the virtual environment of that project to the 3.9.2 version of python? Bryant11 1 1,380 Feb-26-2022, 11:15 AM
Last Post: Larz60+
Shocked Issues Installing Pyenv/Python 3.9.1 Brandon_Contactum 1 2,542 Feb-22-2022, 06:32 PM
Last Post: snippsat

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020