Virtualenv python between Win/Linux machines

Asked

Viewed 39 times

-2

I got a problem, somebody’s been through it ?

I have a Python/Django project on a linux pc, and this project is in a repository on github.

Dei git clone in this repositorio on another windows pc, so far so good, now I try to install anything with Pip install and the venv activates it error.

The problem is with the virtual env of the repositorio project, because to test, in this windows pc I created a new venv, activated it and works normally Note the venv ( test) this was created on the windows pc itself for testing, works normal inserir a descrição da imagem aqui

this is the venv of the github project folder la, this venv was created on another pc inserir a descrição da imagem aqui

this is the mistake that gives inserir a descrição da imagem aqui

Can someone help me understand what the problem is? and how can I prevent it from happening, so that I can work on multiple machines in the same project.

1 answer

2

"virtualenv" should not be included in GIT versioned files. The libraries and modules that are installed for a project to work on virtualenv are always dependent on the operating system and architecture where the project is running.

The right thing is to delete the virtualenv folder from git - and on each computer where you download the project, create a specific virtualenv for that computer (and inclsuive, for that folder where you cloned the project, if you clone more than one place).

If the project is configured right, a "Pip install ." or "python setup.py develop" will install the dependencies on the target machine.

  • In case when I go up a Django project on github, the ideal is just to go up the "Script" folder which is where the Django files will be?

  • you need the files that Jango creates, when you run "Manage startproject" - and you need to see doc. in parallel on how to turn the Django project into a Python project - with setup.py or use "Poetry" and have "pyproject.toml". But nothing from virtualenv

  • Putz, I always created a venv and in this same directory I created the github remote and climbed the entire venv to github, so around and a half had these problems. Thank you for answering my question even though it’s all messed up.

  • no - are complementary concepts, practically "made" to work both, but without mixing: version control (git),ensures that the files that are unique for your project to work (the source code) are the same on any computer. Package management by environment (venv) ensures that in each installation, the appropriate requirements for project operation are installed for the specific architect and S.O. (and your project is "built" if there is this step), as automatically as possible .

Browser other questions tagged

You are not signed in. Login or sign up in order to post.