Questions tagged [virtualenv]

virtualenv is a tool that creates sandboxed Python environments.

virtualenv allows you to create a sandboxed and isolated environment where Python packages can be installed without interfering with other packages on the same machine. With several virtualenvs, many different pieces of Python software with different and even mutually exclusive dependencies can coexist together.

Basic usage:

$ virtualenv ENV
$ source ENV/bin/activate
(ENV) $ easy_install (package)
(ENV) $ deactivate
$ ...

A virtualenv can also be set up to completely ignore the system's site packages, to ensure that all dependencies are installed within the virtualenv sandboxed environment.

$ virtualenv ENV --no-site-packages
57 questions
67
votes
7 answers

Can't install virtual interpreter in PyCharm in Linux

When I try to add virtualenv as an interpreter in PyCharm Community 2018.1.2 in Kubuntu 18.04 I get the following error: ModuleNotFoundError: No module named 'distutils.core' How can I solve this?
Hrvoje T
  • 1,959
28
votes
7 answers

`python3.7: bad interpreter: No such file or directory`

I installed Python, pip3, and virtualenv as in this guide for TensorFlow: brew install python pip3 install -U virtualenv Then I was able to create a virtual environment with: virtualenv --system-site-packages -p python3 ./venv Then I tried…
ginjaemocoes
  • 2,151
17
votes
6 answers

bash shell error: "no such file or directory"

I am trying to install Virtualenv wrapper on Ubuntu 14.04. But whenever I start a terminal, I get the error saying bash: /usr/share/virtualenvwrapper/virtualenvwrapper_lazy.sh: No such file or directory. I also checked the bashrc script by using…
17
votes
5 answers

What is the alternative for source command in cmd?

I want to run the Windows (Command Prompt) equivalent of source myvenv/bin/activate so as to activate and enter into my virtual environment.
14
votes
1 answer

Create a Python 3 virtual environment

I installed python3-virtualenv on Lubuntu 15.1 using the official Ubuntu package apt-get install python3-virtualenv. The official documentation indicates that a simple virtualenv . in my project directory should be enough to create the venv. This…
Escher
  • 339
11
votes
2 answers

Hook into "command not found" handler in Ubuntu

I want to hook into the handler for command not found wim@SDFA100461C:~$ thing No command 'thing' found, did you mean: Command 'tping' from package 'lam-runtime' (universe) Command 'thin' from package 'thin' (universe) thing: command not found I…
wim
  • 3,327
9
votes
2 answers

What do double curly braces mean in systemd scripts?

A stackoverflow answer about running python scripts upon system startup uses {{ and }} in its syntax. What do they mean? ExecStart={{ venv_home }}/bin/fooservice --serve-in-foreground I am also not clear where venv_home comes from. I can't find it…
5
votes
2 answers

Activate virtualenv using alias

I can activate my python virtual environment from it's folder by entering . bin/activate. I'd like to instead type a single word alias, such as shazam, from the home folder (or anywhere else) that activates the environment, changes to my master…
4
votes
1 answer

Why is it when I started virtualenv on macOS, I am then unable to deactivate it completely?

I started virtualenv on my macOS, using these commands: python -m virtualenv envsp source env/bin/activate Then it was successfully activated. Then I entered exit, and I got a response which says logout Saving session... ...copying shared…
3
votes
0 answers

How do I recompile Python in VirtualEnv?

I built virtualenv and it adds Python 2.7 by default in it. After reading this solution to a bug I have, it says I have to recompile Python with the option --enable-shared. So should I rm -rf Python from the virtualenv and download it again?
User
  • 851
3
votes
2 answers

Permission Denied When Trying to Create Python3 Virtual Environment

Ubuntu 18.04 LTS I'm trying to allow users to create their own virutalenv for python3, however when trying to create said environment using a standard user account with this command:$ python3 -m venv ~/path/to/venv I get this error: Error: [Errno…
Jon
  • 53
3
votes
1 answer

macOS Catalina (10.15) not using correct Python interpreter within virtual environment

Since updating to Catalina, after activating a virtual environment, it does not affect which python interpreter is called when using the python or python3 command. I confirmed that I am still using Bash as default in my terminal. I use the which…
3
votes
1 answer

Python virtualenv not activating in Windows 10 Cmder

I use Cmder on windows 10 with Python 3.5 and virtualenv on my laptop and work computer just fine. Now I have a new computer running Windows 10, Python 3.5, virtualenv 15.0 and I am able to initialize a python virtual environment with: virtualenv…
Chaz
  • 133
3
votes
1 answer

shell environment setup for virtualenv/virtualenvwrapper

The question is about shell setup for virtualenvwrapper, an extension to virtualenv (python guide). Similar questions had been asked many times but with a lot with different answers: Environment variables in bash_profile or bashrc? Difference…
hute37
  • 201
  • 2
  • 6
2
votes
1 answer

Error "You must 'source' the script:" while trying to ativate python virtualenv on Windows10

python 3.7.1 Windows 10 Powershell Steps taken: create folder for envs change to folder pip install virtualenv virtualenv "abc" abc\Scripts\activate This throws the error stated in the title. I have tried activate and activate.ps1. They both result…
bsbaixo
  • 23
1
2 3 4