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...
#7
One day, I installed a module, I can't even remember what it was. While it was installing, I noticed that it installed a version of pillow.

After that, im.show() would not work, don't know where the problem lies.

from PIL import Image
# pics is a list of image names
for pic in pics:
    im = Image.open(pic)
    im.show()
I can now only do this in a venv

I got this advice from https://realpython.com/python-virtual-en...-a-primer/

Quote:Made a directory in /home/pedro called PVE. Go there in bash then:

1. python3 -m venv OMRenv (python3 -m venv new_directory_name)
2. In bash: source OMRenv/bin/activate then you are working within the venv
3. Type deactivate in bash when you see (OMRenv) to deactivate the virtual environment.
4. You can run IDLE within the activated virtual environment with this command:
python -m idlelib.idle (works well)

Just these last few days I needed to do stuff with a lot of photos, so I made a directory /home/pedro/images

I go to the folder images then activate and the bash prompt changes to this:

Quote:(images) pedro@pedro-HP:~/images$

Quote:pedro@pedro-HP:~/images$ source images/bin/activate
(images) pedro@pedro-HP:~/images$ deactivate
pedro@pedro-HP:~/images$
Reply


Messages In This Thread
RE: Keeping up with IDEs and Virtual Environments... - by Pedroski55 - Sep-05-2022, 09:02 AM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Best practice on using virtual environments in Python bytecrunch 6 1,148 Feb-14-2024, 03:22 PM
Last Post: snippsat
  Virtual Environments - Organization (VS Code) JaysonWonder 11 2,030 Jan-26-2023, 11:34 PM
Last Post: Larz60+
  I don't understand pip and environments snakes 3 1,318 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,541 Mar-13-2022, 10:50 PM
Last Post: Yoriz
  Use different Anaconda environments on Linux Mint and Spyder StaLLoNe_CoBRa 0 1,927 Jan-20-2021, 03:12 AM
Last Post: StaLLoNe_CoBRa
  pip and venv virtual environments soupworks 2 2,354 Dec-30-2020, 11:38 PM
Last Post: soupworks
  Traceback error in PyCharm but not in other IDEs? devansing 7 6,531 Mar-05-2020, 11:27 AM
Last Post: buran
  Problem keeping the window up benlyboy 11 4,327 Jan-24-2020, 02:12 AM
Last Post: tamilselvisubbiah
  Virtual Environments pneveux 1 1,886 Apr-04-2019, 09:15 PM
Last Post: Larz60+
  merging lists, dedup and keeping order, in older pythons Skaperen 3 3,246 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