Python Forum
Keeping up with IDEs and Virtual Environments...
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Keeping up with IDEs and Virtual Environments...
#8
@Pedroski55 you should make a your own Thread.
As the topic is kind of similar i don't move Thread for now.

What you doing is confusing,you make folder /home/pedro/images
Do you make this folder with mkdir or with venv?
When you use venv its making a new folder.

I would do it like this,i always end _env so know that folder is used for virtual environment.
# Make 
G:\div_code
λ python -m venv image_env

# cd in
G:\div_code
λ cd image_env\

# Activate 
# Linux <source /bin/activate>
G:\div_code\image_env
λ G:\div_code\image_env\Scripts\activate

# install Pillow
(image_env) G:\div_code\image_env
λ pip install pillow
Collecting pillow
  Downloading Pillow-9.2.0-cp310-cp310-win_amd64.whl (3.3 MB)
     ---------------------------------------- 3.3/3.3 MB 6.2 MB/s eta 0:00:00
Installing collected packages: pillow
Successfully installed pillow-9.2.0

(image_env) G:\div_code\image_env
At this point can make images folder in image_env folder.
Or navigate to where you have images as long as (image_env) is activate,
no matter what folder you are in it will use Python from this environment(that has Pillow installed).
Example:
(image_env) C:\Users\Tom
λ cd C:\foo\images

# In different folder as activate (image_env) will use python executable from this environment 
(image_env) C:\foo\images
# Test what python interpreter used,see it point to image_env
λ python -c "import sys; print(sys.executable)"
G:\div_code\image_env\Scripts\python.exe 
Reply


Messages In This Thread
RE: Keeping up with IDEs and Virtual Environments... - by snippsat - Sep-05-2022, 08:04 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Best practice on using virtual environments in Python bytecrunch 6 1,471 Feb-14-2024, 03:22 PM
Last Post: snippsat
  Virtual Environments - Organization (VS Code) JaysonWonder 11 2,147 Jan-26-2023, 11:34 PM
Last Post: Larz60+
  I don't understand pip and environments snakes 3 1,379 Jul-31-2022, 08:17 PM
Last Post: snakes
  Keeping a value the same despite changing the variable it was equated to TheTypicalDoge 2 1,606 Mar-13-2022, 10:50 PM
Last Post: Yoriz
  Use different Anaconda environments on Linux Mint and Spyder StaLLoNe_CoBRa 0 1,964 Jan-20-2021, 03:12 AM
Last Post: StaLLoNe_CoBRa
  pip and venv virtual environments soupworks 2 2,394 Dec-30-2020, 11:38 PM
Last Post: soupworks
  Traceback error in PyCharm but not in other IDEs? devansing 7 6,669 Mar-05-2020, 11:27 AM
Last Post: buran
  Problem keeping the window up benlyboy 11 4,441 Jan-24-2020, 02:12 AM
Last Post: tamilselvisubbiah
  Virtual Environments pneveux 1 1,920 Apr-04-2019, 09:15 PM
Last Post: Larz60+
  merging lists, dedup and keeping order, in older pythons Skaperen 3 3,292 Oct-19-2018, 01:30 AM
Last Post: ODIS

Forum Jump:

User Panel Messages

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