python多版本py命令及虚拟环境管理

创建虚拟环境失败, 已经很久没有用python3这个命令,可能又被系统环境修改的时候弄乱了.花点时间整理下

$ python3 -m venv ./venv

Error: Command '[‘E:\code\venv\Scripts\python.exe’, ‘-Im’, ‘ensurepip’, ‘–upgrade’, ‘–default-pip’ returned non-zero exit status 1.

把从windows store 下载的python3.8版本给卸了, 从官网下载python3.11

使用py 替代 python命令

默认py命令创建虚拟环境
$ py -m venv venv
进入vscode
& e:/code/venv/Scripts/Activate.ps1
$ pip3 install -r requirements.txt -i https://mirrors.ustc.edu.cn/pypi/web/simple/

ERROR: Ignored the following versions that require a different python version: 1.21.2 Requires-Python >=3.7,<3.11; 1.21.3
Requires-Python >=3.7,<3.11; 1.21.4 Requires-Python >=3.7,<3.11; 1.21.5 Requires-Python >=3.7,<3.11; 1.21.6 Requires-Python >=3.7,<3.11; 1.6.2 Requires-Python >=3.7,<3.10; 1.6.3 Requires-Python >=3.7,<3.10; 1.7.0 Requires-Python >=3.7,<3.10; 1.7.0rc1 Requires-Python >=3.7,<3.10; 1.7.0rc2 Requires-Python >=3.7,<3.10; 1.7.1 Requires-Python >=3.7,<3.10; 1.7.2 Requires-Python >=3.7,<3.11; 1.7.3 Requires-Python >=3.7,<3.11; 1.8.0 Requires-Python >=3.8,<3.11; 1.8.0rc1 Requires-Python >=3.8,<3.11; 1.8.0rc2 Requires-Python >=3.8,<3.11; 1.8.0rc3 Requires-Python >=3.8,<3.11; 1.8.0rc4 Requires-Python >=3.8,<3.11;
1.8.1 Requires-Python >=3.8,<3.11
ERROR: Could not find a version that satisfies the requirement torch>=1.7.0 (from versions: none)
ERROR: No matching distribution found for torch>=1.7.0

又从官网下了python3.9

$ py --list
-V:3.11 *        Python 3.11 (64-bit)
-V:3.9           Python 3.9 (64-bit)
-V:3.6-32        Python 3.6 (32-bit)# win10系统自带的.无法卸载
-V:2.7 # 老项目使用,这个环境不能动

py指定python版本,生成虚拟环境,目录下文件名为venv
$ py -3.9 -m venv venv
进入vscode

win
$ & e:/code/venv/Scripts/Activate.ps1
mac
$ source ./venv/bin/activate

退出

$ deactivate

$ pip3 install -r requirements.txt -i https://mirrors.ustc.edu.cn/pypi/web/simple/

正常完成requirements下载

centos安装python3.9

wget https://www.python.org/ftp/python/3.9.6/Python-3.9.6.tgz

tar -xf Python-3.9.6.tgz

cd Python-3.9.6

./configure 或者 ./configure --enable-optimizations
问题: https://blog.csdn.net/hd243608836/article/details/121418565
make altinstall
注意使用altinstall而不是install,以避免覆盖系统默认的Python版本。
python3.9 --version
Python 3.9.6

  • 7
    点赞
  • 15
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
================================== ==注意:一共2个压缩包,这是第1个== ================================== *提示:无自动安装程序,包含所有源码、例子、帮助,请按照安装顺序安装!!! DevExpress VCL v2012 vol 2.6 包含所有源码、例子、帮助 如果你安装过其它版本的DevExpressVCL,安装前请完全卸载老版本的Dev控件,并执行“清理Dev残余文件”,清理System32下的DevExpress的BPL文件。 What's New in DevExpress VCL 12.2.6 Release Notes Feature Highlights To learn about feature highlights in this version, please refer to the following page: New Features - DevExpress VCL 12.2.6 Known Issues To learn about known issues in this version, please refer to the following page: Known Issues - DevExpress VCL 12.2.6 The following sections list all minor and major changes in DevExpress VCL 12.2.6. Note that products, controls and libraries which aren't mentioned in the list below are included in the unified installer for compatibility, but have not been updated. New Features/Changes ExpressQuantumTreeList Suite Q484199 - Documentation - Provide an example of how to use the TcxCustomTreeList.Find function Resolved Issues VCL Subscription B232998 - Documentation - The OnValidateDrawValue event is not described ExpressBars Suite Q492229 - Activating an MDI child window always repaints it, regardless of the bar manager's AlwaysMerge property value Q490246 - Changing a bar item's Visible property when a form is being destroyed results in an AV Q489146 - Ribbon - A Ribbon tab group's Caption property does not apply to the group caption if this group is displayed in a popup window Q489457 - Ribbon - TdxRibbonBackstageView - In RAD Studio XE or later, an AV occurs when changing the parent of a currently hidden form with the BackstageView after the form Position property has been set to poDesigned and the toolbar on this form made visible Q486834 - Ribbon - TdxRibbonBackstageView - Invoking the BackstageView does not move focus to it from the currently focused control that resides on a form with this BackstageView B233045 - Ribbon - TdxRibbonBackstageView - Right-clicking an empty spa
Mac OS X Unlocker for VMware ============================ 1. Introduction --------------- The package is a combination of the Unlocker code written by Zenith432 plus some scripts written by myself that wrap the actual unlocker code. It has been tested against: * Workstation 8.0 on Windows and Linux (32 & 64-bit versions) * Player 4.0 on Windows and Linux (32 & 64-bit versions) * Fusion 4.0 on Snow Leopard and Lion * ESXi 5.0 * Workstation Tech Preview March 2012 * Fusion Tech Preview March 2012 The patch code carries out the following modifications dependent on the product being patched: * Fix vmware-vmx and derivatives to allow Mac OS X to boot * Fix vmwarebase .dll or .so to allow Apple to be selected during creation * Copy darwin.iso if needed to VMware folder Note that not all products recognise the darwin.iso via install tools menu item. You will have to manually mount the darwin.iso for example on Workstation. Also Player is missing vmware-vmx-debug and vmware-vmx-stats files and so an error is shown during patching as the files are not found. This can be safely ignored. In all cases make sure VMware is not running, and any background guests have been shutdown. 2. Windows ---------- On Windows you will need to either run cmd.exe as Administrator or using Explorer right click on the command file and select "Run as administrator". install.cmd - patches VMware and copies darwin.iso tools image to VMware uninstall.cmd - restores VMware and removes darwin.iso tools image from VMware 3. Linux --------- On Linux you will need to be either root or use sudo to run the scripts. You may need to ensure the contents of the linux folder have execute permissions by running chmod +x against the 4 files. install.sh - patches VMware and copies darwin.iso tools image to VMware uninstall.sh - restores VMware and removes darwin.iso tools image from VMware 4. Mac OS X ----------- On Mac OS X you will need to be either root or use sudo to run the scripts. This is really only needed if you want to use client versions of Mac OS X. You may need to ensure the contents of the osx folder have execute permissions by running chmod +x against the 3 files. install.sh - patches VMware uninstall.sh - restores VMware 5. ESXi ------- ESXi has to be patched using the scripts, as the unlocker is used to overlay the ESXi firmware at runtime. You will need to transfer the files to the ESXi host either using vSphere client or SCP. Once uploaded you will need to either use the ESXi support console or use SSH to run the commands. Please note that you will need to reboot the host for the patches to become active. You may need to ensure the contents of the esxi folder have execute permissions by running chmod +x against the 3 files. install.sh - patches VMware uninstall.sh - restores VMware 6. Zenith432's Unlocker ----------------------- In all cases the unlocker can be run without the scripts but you would need to carry out additional actions which the scripts encapsulate for you especially on ESXi. If you want to run the unlocker directly the parameters are: Usage: ./Unlocker.Linux64 [-h] [-u] [target_directory] -h: print help -u: remove the patch target_directory: customize location of vmx executables On all platforms you must run it with administrator or root privileges. The source code is provided and Zenith432 makes it freely available for modification. In 1.1.0 I have modified the code and it is available as per Zenith432's original statement. Thanks to Zenith432 for building the unlocker and Mac Son of Knife for all the testing and support. History ------- 11/10/11 1.0.0 - First release 07/11/11 1.0.1 - Fixed typo in Windows command files 07/12/11 1.0.2 - Updated patcher and tools for latest release WKS 8.0.1 & FUS 4.1.1 10/05/12 1.1.0 - Changed the patching mechanism for vmwarebase .dll or .so & tested against ESXi 5.0 U1 and Tech Previews. (c) 2011-2012 Dave Parsons

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值