在网络驱动器上为 Windows 10 设置虚拟环境 [英] Setting up virtual environment on network drive for Windows 10

查看:46
本文介绍了在网络驱动器上为 Windows 10 设置虚拟环境的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在家用计算机上有一个项目(非生产,未分发),我想将其移动到我的 NAS 以在多台 Windows 计算机上进行编辑.我已将文件夹复制到 NAS,创建了 requirements.txt 文件,将命令提示符更改为网络驱动器,并尝试了以下各项.

I have a project (non-production, not distributed) on a home computer that I want to move to my NAS for editing on multiple Windows computers. I have copied the folder to the NAS, created the requirements.txt file, changed the command prompt to the network drive, and tried each of the following.

mkvirtualenv -a "\\NAS\Coding\venv" -r "\\NAS\Coding\local-project\requirements.txt" venv-local-project
mkvirtualenv -r "\\NAS\Coding\local-project\requirements.txt" venv-local-project
mkvirtualenv venv-local-project
virtualenv venv-local-project

无论我用命令做什么,它都会在 C: 上创建虚拟环境.

No matter what I did with the command, it would create the virtual environment on C:.

"X:\venv-local-project" is now the project directory for
virtualenv "C:\Users\My Name\Envs\venv-local-project"

所以,基于这个https://stackoverflow.com/a/47705468/11792868,我添加了环境变量 WORKON_HOME 并将 NAS 文件夹的路径设置为其值.

So, based on this https://stackoverflow.com/a/47705468/11792868, I added the environmental variable WORKON_HOME and set the path to the NAS folder as its value.

现在,当我尝试运行相同的命令时,出现此错误:

Now, when I try running the same commands, I get this error:

OSError: [WinError 4390] The file or directory is not a reparse point: 'c:\\python\\python.exe' -> '\\\\NAS\\Coding\\venv\\venv-local-project\\Scripts\\python.exe'

任何有关我需要做什么才能使其工作或我如何在网络驱动器上设置虚拟环境的任何建议将不胜感激.最终,我想在网络驱动器上进行所有编程.

Any suggestions on what I need to do to get this to work or how I go about setting up the virtual environment on the network drive would be greatly appreciated. Eventually, I would like to do all of the programming on the network drive.

推荐答案

我可能错了,但你不能用 virtualenv 做到这一点,因为它是为在你的本地系统中开发而设计的.Stackoverflow T1Stackoverflow T2

I may be wrong, but you cannot do this with virtualenv as it is meant for development in your local system. Stackoverflow T1 Stackoverflow T2

我要做的是使用 pip freeze 并创建 requirements.txt 文件并在所有本地计算机中创建 virtualenv 并使用该 virtualenv 终端访问 NAS 并运行它.如果有任何替代解决方案,我欢迎

What I would do is use pip freeze and create requirements.txt file and create virtualenv in all the local computers and use that virtualenv terminal to access NAS and run it. If there are any alternative solutions,I am welcoming it

这篇关于在网络驱动器上为 Windows 10 设置虚拟环境的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆