-
-
Notifications
You must be signed in to change notification settings - Fork 1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
How to copy a virtual env to another compute and make it works? #1035
Comments
Sorry, but that's not a supported situation. Your most practical solution would likely be to manually download the packages you need, and put them in a location that is accessible to the Python 2.6 servers, and then install them with pip using An alternative might be to put Python 2,6 on your development system, build a virtualenv as you describe but using Python 2.6, and then copy that virtualenv to the target servers. But frankly, that's still a high-risk approach and I don't believe we'd support that, so if you did hit issues you'd have to resolve them on your own. The |
Thanks for your reply.First I want to reslove below two questions,do you have any suggestion? 2.when I run cmd "which python" returns python path in virtualenv,but run cmd "python -V" it returns Python2.6.6? actually the python2.7 is my expect. how to set python2.7 of virtualenv supported as system default python version? Appreciate your reply! |
Honestly, I've no idea how to answer your questions. You simply shouldn't do that and if you do things will fail in unexpected ways. You have copied a partial but incomplete Python 2.7 installation to the target machine which doesn't have Python 2.7 on, but does have Python 2.6 (presumably in the system directory where Python 2.7 would expect the system install of Python 2.7 to be present). It's hard to see how anything sensible could happen in a situation like that. |
This is out of scope for this project. |
1, I create a virtual env in linux server A,,which has installed python2.7,blow as detailed steps:
virtualenv ./python27env
source ./python27env/bin/activate
pip install xxxxx1
pip instal xxxxx2
virtualenv --relocatable ./
deactivate
2, now make virtualenv python27env as a tar file:
tar -cvf python27env.tar.gz ./python27env
3.use scp command copy above python27env.tar.gz to linux server B, which only has installed python2.6, blow as detailed steps:
tar -xvf python27env.tar.gz
virtuaenv ./python27env ----no-site-packages
source ./python27env/bin/activate
4.question
A,now run cmd "ls ./python27env/lib", the result present both python2.6 and python2.7, how to only remain python2.7?
B.run cmd "which python" returns python path in virtualenv,but when I run cmd "python -V" it returns Python2.6.6? actually the python2.7 is myi expect.
notes:My actual work scene is: my application is developed under python2.7 and it dependencies many 3rd packages, I want deploy my application to the servers which are installed python2.6 or other versions(python3.x), and other servers can not use pip to install packages due to these servers can not connect internet. I am not sure virtualenv is fit for me?
Thanks for your reply!
The text was updated successfully, but these errors were encountered: