简体   繁体   中英

virtual environment from Mac to Linux

I recently made a django project using virtualenv on my mac. That mac broke, but I saved the files and now I want to work on my project using my linux computer. I am now having some difficulty running the virtual environment in Ubuntu.

Does it even make sense to try and use a virtual env made in Mac OS on Ubuntu?

Thanks

You can just recreate the virtual environment on Ubuntu. The virtual env will have the python binary which will be different on a different system.

Install pip

sudo apt-get install python3-pip

Install virtualenv using pip

sudo pip3 install virtualenv 

Create a virtual environment

virtualenv venv 

You can use any name instead of venv.

You can also use a Python interpreter of your choice

virtualenv -p <python2> <python3> <python3.7> venv

Activate your virtual environment

source venv/bin/activate

You only have to recreate virtualenv. That's all.

If you have a requirements.txt file then use pip to install the requirements:

pip install -r requirements.txt

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM