为python virtualenv安装exe依赖

需求是这样的:

由于项目是跑在linux下的,但是调试和开发都在本机(windows)下面的呀。

于是乎配本地环境,发现很多依赖装不上,包括并且不限于:mysql-python、pywin32……

实际安装的过程中,发现这两个依赖在windows下只有exe安装包是可用的,编译安装是不可行的,因此对系统的VC什么鬼的要求挺多。

题外话,python和系统都是64位的,32位可能不会那么罗嗦。

不想折腾,还要干活啊~

把exe包下下来之后,傻眼了,我用虚拟环境的呀,exe只能安装在主python上。



试过改PATH,是不行的,没有效果。

那应该是注册表。

具体是哪里呢?

经过不懈努力,终于找到了:

HKEY_LOCAL_MACHINE\SOFTWARE\Python\PythonCore\2.7\InstallPath

把“默认”字符串值修改成virtualenv的路径就好了。

例如我修改成:


就可以安装到这个里面了:




实测可行~各位都试试。




  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
Tweaking.com - Windows Repair 1.9.18老朽痴拙汉化便携版(系统修复)是一个免费的绿色软件,解压后就可以开始使用。windows是一个脆弱的操作系统,安装软件,过度优化等操作都会让其运行不稳定,或者崩溃。所以当你发现系统有小问题的时候,你就应该想办法修复它,从而避免错误的扩散。这次介绍的Windows Repair就是一个有针对性的修复软件,如果你束手无策,那么使用它可能会有意想不到的效果。这个软件支持的系统也是非常广泛。windows xp,2003,vista、2008、windows 7、windows 8 都可以使用它。   打开这个软件后,是一个向导式的界面,上面有步骤。其实我们只需要选中其中的“开始修复”界面,然后使用“自定义模式”这个自定义修复模式。   点击 开始 后就会看到自己选择需要修复的项目。 Windows Repair所有能够修复的windows问题:   1、重置注册表权限。   2、重置文件权限。   3、注册系统文件。   4、修复wmi.(一项核心的windows管理技术),可能也就是windows自带的“管理”功能。   5、修复windows防火墙。   6、修复ie浏览器。   7、修复MDAC和MS jet。(微软数据库访问组件和资料引擎)   8、还原host文件。   9、修复图标。 10、修复winsock和刷新DNS缓存。   11、删除临时文件。   12、修复代理设置。   13、不隐藏非系统文件。   14、修复windows更新功能。 ...... Tweaking.com - Windows Repair Change Log. v1.9.18 Bug fix: The program would get stuck in a opening and closing loop when you had it set to auto restart after repairs. This was because of a timer not turning off and wanting to update the window while it was closing down, thus the loop. This has now been fixed and the program closes like it should. New feature: Since I had to get this bug fixed quickly I decided to take the time to add a new feature I came up with. In the steps before the repairs, Step 2 asks the user to do a check disk (chkdsk) on the system to make sure there is no file system errors before doing any repairs. I hated the fact that I forced the user to reboot to scan it when there may not be any errors on the file system. So I have added a new option to this step where the program will check the drive for errors and let you know if any are found. It is done by making a pipe to a cmd.exe window and running chkdsk in read only mode. Once chkdsk is done it looks for the key words "Windows found problems" and can let the user know if running chkdsk is even needed. Thus saving the user a reboot if there are no errors. I also have it log the chkdsk results to a chkdsk.log file in the logs folder in case a user wants to see the results of the chkdsk. :-)
PythonVirtualenv是一个用于创建和管理独立Python环境的工具。它可以让你在同一台机器上拥有多个独立的Python环境,每个环境可以有自己的Python版本和安装的软件包,而不会相互影响。 使用Virtualenv可以帮助你解决不同项目之间的依赖冲突问题。例如,你可以在一个项目中使用Python 2.7,而在另一个项目中使用Python 3.8,而不会相互干扰。 要使用Virtualenv,你可以先安装它,然后通过命令行创建一个新的虚拟环境。以下是一些使用Virtualenv的基本步骤: 1. 安装Virtualenv:在命令行中运行`pip install virtualenv`来安装Virtualenv。 2. 创建虚拟环境:在命令行中进入你想要创建虚拟环境的目录,然后运行`virtualenv <环境名称>`来创建一个新的虚拟环境。例如,`virtualenv myenv`将创建一个名为"myenv"的虚拟环境。 3. 激活虚拟环境:在命令行中运行`source <环境名称>/bin/activate`(对于Windows系统,运行`<环境名称>\Scripts\activate`)来激活虚拟环境。一旦激活,你将在命令行的提示符前看到环境名称。 4. 安装软件包:在虚拟环境中,你可以使用`pip`来安装所需的Python软件包,就像在全局Python环境中一样。这些软件包将被安装在虚拟环境的文件夹中,而不会影响全局Python环境。 5. 退出虚拟环境:要退出虚拟环境,只需在命令行中运行`deactivate`即可。 通过使用Virtualenv,你可以轻松地管理和隔离不同项目的Python环境和依赖。这对于开发和部署应用程序时非常有用。
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值