Questions tagged [virtual-environment]

544 questions
4
votes
3 answers

Do I use `pyvenv` or `virtualenv` for creating a virtual environment?

Some guides mention pyvenv (not pyenv) when talking about virtual environments such as the official Python tutorial. Others mention virtualenv such as in the Hitchhiker's Guide to Python. I've tried pyvenv and I think that it worked as you can…
Ammar Alyousfi
  • 4,112
  • 5
  • 31
  • 42
4
votes
2 answers

Running Virtual Environment Ansible

I am trying to run a virtual environment in Ansible. It is constantly erroring out. Here's the code: - name: Install virtualenv pip: name=virtualenv when: virtualenvexists.stat.exists != true - name: Create virtualenv sudo: true command:…
Steven Matthews
  • 9,705
  • 45
  • 126
  • 232
3
votes
0 answers

What are the differences between "conda env export -> environment.yml" and "conda list -> spec.txt"? And which is better?

conda env export -> environment.yml conda list -> spec-file.txt (All produce raw text. File names seems to be convention) The document is a little bit confusing. It seems that the only differences are: environment.yml has name and channel…
3
votes
0 answers

How do you identify the difference between files in 2 different directories (including the subdirectories within the 2 dirs) to then create a patch?

I am looking to create a patch for my project so I may 'automatically' implement changes to specific packages (i.e. pycaret, sklearn, etc.) as I continue to develop my project in the future. I have installed these packages on a virtual environment…
3
votes
0 answers

VSCode does not automatically activate python interpreter of conda environment in WSL2

I have installed (Mini) Conda in an Ubuntu 20.04 instance running on WSL2, and I have created a virtual environment (myenv). First, the path to the interpreter does not appear when I perform Python: Select Interpreter, so I have manually inserted…
aretor
  • 2,379
  • 2
  • 22
  • 38
3
votes
0 answers

"No pyvenv.cfg file" error thrown when launching Python virtual environment

I am working with a Python virtual environment on a Windows machine. I used venv with Python 3.10 to create the environment and pip to install libraries. I have used this environment successfully with Jupyter Lab - launching it from the command…
mbela
  • 31
  • 1
  • 4
3
votes
2 answers

Setting environment variables on docker before exec

I'm running a set of commands on an ubuntu docker, and I need to set a couple of environment variables for my scripts to work. I have tried several alternatives but none of them seem to solve my problem. Alternative 1: Using --env or --env-file On…
Sergio
  • 377
  • 1
  • 3
  • 18
3
votes
1 answer

pip is configured with locations that require TLS/SSL while installing numpy in VSCode virtual environment

I got the error: pip is configured with locations that require TLS/SSL, however the ssl module in Python is not available. while trying to install numpy inside a virtual environment in visual studio code. I have noticed the following: If I do "pip…
3
votes
3 answers

Problems installing Python packages into a virtual environment in Visual Studio Code

Although I'm enjoying developing in Python in Visual Code, I'm finding managing virtual environments and packages frustrating, and particularly am struggling with installing packages in the right place. Here's my sequence of steps, and the problem…
Andy Brown
  • 5,309
  • 4
  • 34
  • 39
3
votes
1 answer

How do I make sure conda's environment-specific paths are at the top of sys.path?

I have a conda environment, myenv. I realized that the Python interpreter in this environment tries to import packages from /Users/me/.local/lib/python3.8/site-packages before /usr/local/anaconda3/envs/myenv/lib/python3.8/site-packages. I would have…
sjplural
  • 663
  • 1
  • 8
  • 11
3
votes
2 answers

Azure app service cannot find installed modules

I am attempting to deploy a Django app to a Linux server via an Azure App Service. During the deployment via Azure Devops Pipelines, all requirements are installed from my requirements.txt file in the root directory of my project. I have used the…
3
votes
2 answers

Poetry already added module, but not installed

My pyproject.toml is something like this [tool.poetry.dependencies] python = "^3.8" numpy = "^1.19.4" pandas = "^1.1.5" matplotlib = "^3.3.3" seaborn = "^0.11.0" lightgbm = "^3.1.1" jupyter = "^1.0.0" notebook =…
Tomoand
  • 91
  • 1
  • 1
  • 7
3
votes
0 answers

Export virtual environment created with venv to yaml file [no conda]

I have created a virtual environment using: python3 -m venv env_name. I worked with this and installed all packages required for my work using pip3. Now I want to export this to a remote server. Which takes only the YAML file, and creates a conda…
Rishabh Gupta
  • 389
  • 6
  • 19
3
votes
1 answer

switch between anaconda virtual environments and uses of activate/deactivate/remove

I currently have miniconda installed and one virtualenvironment + base environment. conda env list # conda environments: # base * /home/alex/miniconda3 machinelearning /home/alex/miniconda3/envs/machinelearning As the…
moth
  • 1,833
  • 12
  • 29
3
votes
1 answer

can not import pascalize, depascalize from humps package python

Hello my friends plz help me with this strange problem 1-In my terminal of linux mint I can easily install package humps and then use from humps import pascalize, depascalize with no problem 2-But when I create a virtualenv of pythonand I can…