|
OpenBSD General Other questions regarding OpenBSD which do not fit in any of the categories below. |
|
Thread Tools | Display Modes |
|
|||
How to activate virtual environment?
Hello,
I was trying to activate the virtual environment that I've created with python as local user and even as root but in both situations I got this message: ksh: ./myenv/bin/activate: cannot execute - Permission denied What seems to be the problem? |
|
|||
You don't execute it, you source it.
'. ./myenv/bin/activate' for ksh. |
|
|||
Quote:
By the way could you please explain what is the difference between them? |
|
|||
It executes the commands in the current shell.
Why do that and not create a sub-shell? I'm not sure. I assume there is some practical difference that I don't know about. |
|
|||
Is it not possible to make the resulting shell interactive? I thought I've seen some systems do this. Then when you exit the modified sub-shell, you get you original clean environment back.
|
|
|||
Dear TronDD,
I was making a search at the forum for Python and saw my question again then read all the messages. For your message at #5, I didn't know at that time. The reason for creating a virtual environment(stand-alone Python in that particular folder) is that you don't want to harm the original Python installation of your system, they said. Let's say there are different projects that require different modules, libraries and by creating a virtual environment you'll make sure that nothing will affect each other. For example sometimes a Flask(a Python web development framework) application requires a deprecated library in order to perform and for some other application that deprecated library is not up-to-date so it doesn't perform. EDIT/UPDATE: Also when you ship that folder to someone else, they don't have to deal with the dependencies. All the necessary modules/libraries have been already installed by you. Last edited by gordon.f; 22nd December 2022 at 08:49 AM. Reason: Another use case |
Tags |
python, venv |
Thread Tools | |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
activate SMP on AMD64 | philo_neo71 | NetBSD General | 8 | 18th December 2015 03:58 AM |
armV7 activate turbo | philo_neo71 | NetBSD General | 0 | 20th November 2015 03:50 AM |
OpenBSD in virtualized environment | jjstorm | OpenBSD General | 13 | 26th November 2014 06:04 AM |
Xfce 4.8.0 desktop environment released | J65nko | News | 4 | 18th January 2011 05:23 PM |
Cannot activate partition in XP. | bsdnewbie999 | OpenBSD Installation and Upgrading | 6 | 4th May 2009 05:21 PM |