Questions tagged [python-venv]

Many questions here will have to do with how to setup virtual development environments for Python using the venv command (new as of Python 3.3), the differences between venv and other common packages, such as virtualenv, and the interaction between these virtual environments and other parts of your development system.

Python venv — Creation of virtual environments

The venv module provides support for creating lightweight “virtual environments” with their own site directories, optionally isolated from system site directories. Each virtual environment has its own Python binary (allowing creation of environments with various Python versions) and can have its own independent set of installed Python packages in its site directories.

Many questions here will have to do with how to setup virtual development environments for Python using the venv command (new as of Python 3.3), the differences between venv and other common packages, such as virtualenv, and the interaction between these virtual environments and other parts of your development system.

1349 questions
-1
votes
2 answers

Unable to activate virtual environments on Windows 10 with Python 3.7 using cmd

I am having a problem with activating a virtual environment by the name FYP using cmd on Windows 10. I checked the bat file, which is of 1KB size. See the below commands or image. It should have (FYP) on the start after running the activate.bat…
-1
votes
1 answer

How should I use make to allow me to run all python scripts in a directory?

I'm using the excellent Makefile.venv https://github.com/sio/Makefile.venv to handle various aspects of python virtual environments. To run my hello world program, I have a target: hello: venv $(VENV)/python hello.py Notice that it depends on…
John Lawrence Aspden
  • 17,124
  • 11
  • 67
  • 110
-1
votes
2 answers

Virtualenv intersection (python, django)

When I did the command: mkdir djangoproject cd djangoproject/ python3 -m venv myvenv source myvenv/bin/activate echo Django~=2.0.6 > requirements.txt pip install -r requirements.txt django-admin startproject projectname . python manage.py…
alcoder
  • 437
  • 4
  • 21
-1
votes
1 answer

trouble creating virtual environment for python 3 in windows 10

I want to create a virtualenv in Windows 10 for python 3.7 I'm trying to follow the instruction from python doc So first I entered the command PS T:\python -m venv c:\path\to\myenv it did create directories and files into that path then according…
ecjb
  • 5,169
  • 12
  • 43
  • 79
-1
votes
1 answer

How to use pycharm venv at cross-platform (at linux - windows etc..)?

I have created a virtual environment in pycharm on windows. I've cloned the project to a linux machine running Ubuntu 18.04 and tried creating a venv with same name at linux (I overwrote it with virtualenv venv) but I had to install requirements…
krrrr0
  • 29
  • 2
  • 5
-1
votes
4 answers

Should I delete all my python packages on computer

Ive just learned the importance of using a virtual library for projects using Python and Flask. I have already downloaded some packages including flask-wtf, numPy and pandas. If I have this installed on my computer outside of a virtual environment…
-1
votes
1 answer

How to add different python environment to pycharm

I have two versions of python (2.7 and 3.6) in my system. I have created a virtual environment for python 3.6 using conda commands. Now I have python36 venv in my system. I wanted to use this python version in my Pycharm or Jupyter notebook. Please…
python_interest
  • 874
  • 1
  • 9
  • 27
-1
votes
1 answer

How to configure vagrant venv in pycharm on MAC os?

I created virtual box on my local system and then I did vagrant up in project root directory. I find there is 2 python version. First is python 2.7 available on /usr/bin/python location and second is python 2.7.15 available on source…
Anil Jagtap
  • 1,740
  • 4
  • 27
  • 44
-1
votes
1 answer

virtualenv dependent on where you start python from

I'm normally a unix/Mac person, so I'm not exactly sure how this might be related, but one of my users is on a windows box (windows 7?) running via cmd command line. I have a virtualenv set up for windows, on this one system (other computers work…
Brian Postow
  • 11,709
  • 17
  • 81
  • 125
-1
votes
1 answer

how to get venv to point to older python version

I am trying to clone and run a project on my mac. but on the installation options I have to run: pip install -r requirements.txt I get an error and I am pretty sure its because the project runs on python 2.7 while my venv runs on 3.4 (venv)/* $…
james
  • 519
  • 3
  • 10
  • 19
-1
votes
2 answers

Python 2.7 and Flask - using functions from "Random" module returns "500 Internal Server Error" when using venv

I'm testing a web service written with python and flask. Within that service I want to generate a random number. None of the solutions posted on the web seem to work, as if the "random" module does not work. I checked, and there's no random.py or…
Alex Stone
  • 46,408
  • 55
  • 231
  • 407
-2
votes
2 answers

Why is pip installed in virtual environments by default?

Python's venv module is installing pip in created virtual environments by default, unless instructed not to using --without-pip, as described in docs.python.org. Why is that so? If pip is "just" a package manager, I don't see why it should in any…
Boyan Hristov
  • 1,067
  • 3
  • 15
  • 41
-2
votes
0 answers

Python cant activate venv (endevour os)

i'm on "endevour OS" and i got this error while activate the python-virtualenv, my current py versions is: python 3.11.3 [enter image description here](https://i.stack.imgur.com/pUVRo.png) I've done what you see in the screenshots and i dont know…
Luca-x64
  • 1
  • 3
-2
votes
1 answer

I downloaded a python library, and it still says that the library cannot be found

I am using Windows 11, Visual Studio Code, Python version 3.11.2 and I am trying to download the matplotlib. I was following the tutorial of this link: https://code.visualstudio.com/docs/python/python-tutorial It was helpful for the most part, but…
-2
votes
1 answer

how do I make git stop staging files that are included in .gitignore?

I'm learning git and completely lost track of what I'm doing in the process. I cloned my repo, created a folder structure and a virtual environment (which I wanted to exclude in .gitignore) and staged the whole creation. What I did cronologically,…
eordogh
  • 1
  • 1
1 2 3
89
90