服务器pip3配置requirements.txt时候could not find a version that satisfies the requirement pywin32

93 篇文章 4 订阅
27 篇文章 0 订阅

服务器安装pywin32报错:

 这个没解决我的问题:

pycharm安装pywin32 报错:No matching distribution found for pywin32_棠宁的博客-CSDN博客_no matching distribution found for pywin32

然后还有人这样:

Could not find a version that satisfies the requirement win32api (from versions: ) No matching distribution found for win32api - 咣咣敲代码 - 博客园

我的问题还没解决。

有的人用下面这三种方法可以成功,而我都试了一遍,仍旧没用。

pip install pywin32

or

python -m pip install pywin32

or

pip --trusted-host pypi.python.org install pywin32

然后使用了下面镜像网站安装的一些方法,仍旧没用。

pip install pywin32 -i http://pypi.doubanio.com/simple/ --trusted-host pypi.doubanio.com

pip install pywin32 -i http://pypi.douban.com/simple/ --trusted-host pypi.douban.co

pip install pywin32 -i https://pypi.tuna.tsinghua.edu.cn/simple/ --trusted-host pypi.tuna.tsinghua.edu.cn

报错大同小异,如下:

 于是有试用了一下三个云镜像站。

1)http://mirrors.aliyun.com/pypi/simple/ 阿里云
2)https://pypi.mirrors.ustc.edu.cn/simple/ 中国科技大学
3) http://pypi.mirrors.ustc.edu.cn/simple/ 中国科学技术大学

如前面一样把地址换成这三个试试。

 很多人都已经解决了,我的问题依旧顽固,没弄好。

幸运的小伙伴问题到这里基本已经解决了。

不幸的小伙伴还要往后看,作者痛苦,读者也痛苦。

不像那些画美女图的画手,画手开心,观众也开心。

程序就是一条不归路。

继续往下看吧。

这一个:

先升级pip,再安装pywin32

python -m pip install --upgrade pip

Pycharm 中安装pywin32报错_pywin32安装失败_中二骚年的博客-CSDN博客

仍旧报同样的错。

ERROR: Could not find a version that satisfies the requirement pywin32 (from versions: none)
ERROR: No matching distribution found for pywin32

于是

更新了一下

pip install --upgrade setuptools

然后再安装pywin32,仍旧报错

pip install pypiwin32==228
ERROR: Could not find a version that satisfies the requirement pypiwin32==228 (from versions: 219, 223)
ERROR: No matching distribution found for pypiwin32==228

参考:

完美解决 Could not find a version that satisfies the requirement 安装包名字 (from versions: )_戴国进的博客-CSDN博客

安装pip

LIST_2080Ti@ubuntu-SYS-7049GP-TRT:~/2080$ python -m pip install --upgrade pip
Defaulting to user installation because normal site-packages is not writeable
Requirement already satisfied: pip in /home/LIST_2080Ti/.local/lib/python3.8/site-packages (22.3.1)

创建虚拟环境

pip3 install virtualenv

LIST_2080Ti@ubuntu-SYS-7049GP-TRT:~/2080$ pip3 install virtualenv
Collecting virtualenv
  Downloading virtualenv-20.17.1-py3-none-any.whl (8.8 MB)
     |████████████████████████████████| 8.8 MB 571 kB/s 
Collecting distlib<1,>=0.3.6
  Downloading distlib-0.3.6-py2.py3-none-any.whl (468 kB)
     |████████████████████████████████| 468 kB 43.4 MB/s 
Collecting filelock<4,>=3.4.1
  Downloading filelock-3.9.0-py3-none-any.whl (9.7 kB)
Collecting platformdirs<3,>=2.4
  Downloading platformdirs-2.6.2-py3-none-any.whl (14 kB)
Installing collected packages: distlib, filelock, platformdirs, virtualenv
  WARNING: The script virtualenv is installed in '/home/LIST_2080Ti/.local/bin' which is not on PATH.
  Consider adding this directory to PATH or, if you prefer to suppress this warning, use --no-warn-script-location.
Successfully installed distlib-0.3.6 filelock-3.9.0 platformdirs-2.6.2 virtualenv-20.17.1

查询虚拟环境位置

whereis env

 

安装虚拟扩展包

LIST_2080Ti@ubuntu-SYS-7049GP-TRT:~/2080$ pip install virtualenvwrapper
Collecting virtualenvwrapper

  Downloading virtualenvwrapper-4.8.4.tar.gz (334 kB)
     |████████████████████████████████| 334 kB 438 kB/s 
Collecting stevedore
  Downloading stevedore-4.1.1-py3-none-any.whl (50 kB)
     |████████████████████████████████| 50 kB 3.6 MB/s 
Requirement already satisfied: virtualenv in /home/LIST_2080Ti/.local/lib/python3.8/site-packages (from virtualenvwrapper) (20.17.1)
Collecting virtualenv-clone
  Downloading virtualenv_clone-0.5.7-py3-none-any.whl (6.6 kB)
Collecting pbr!=2.1.0,>=2.0.0
  Using cached pbr-5.11.1-py2.py3-none-any.whl (112 kB)
Requirement already satisfied: platformdirs<3,>=2.4 in /home/LIST_2080Ti/.local/lib/python3.8/site-packages (from virtualenv->virtualenvwrapper) (2.6.2)
Requirement already satisfied: distlib<1,>=0.3.6 in /home/LIST_2080Ti/.local/lib/python3.8/site-packages (from virtualenv->virtualenvwrapper) (0.3.6)
Requirement already satisfied: filelock<4,>=3.4.1 in /home/LIST_2080Ti/.local/lib/python3.8/site-packages (from virtualenv->virtualenvwrapper) (3.9.0)
Building wheels for collected packages: virtualenvwrapper
  Building wheel for virtualenvwrapper (setup.py) ... done
  Created wheel for virtualenvwrapper: filename=virtualenvwrapper-4.8.4-py2.py3-none-any.whl size=24833 sha256=79e4bcd94bd1bd3b9463cdc7948cf2f4c082925ae928146d856d82af6d1908f6
  Stored in directory: /home/LIST_2080Ti/.cache/pip/wheels/47/15/3d/7a26eaf92e79f80a3df3ac5f8e0f0f5b7efdf24d313c594a44
Successfully built virtualenvwrapper
Installing collected packages: pbr, stevedore, virtualenv-clone, virtualenvwrapper
  WARNING: The script pbr is installed in '/home/LIST_2080Ti/.local/bin' which is not on PATH.
  Consider adding this directory to PATH or, if you prefer to suppress this warning, use --no-warn-script-location.
  WARNING: The script virtualenv-clone is installed in '/home/LIST_2080Ti/.local/bin' which is not on PATH.
  Consider adding this directory to PATH or, if you prefer to suppress this warning, use --no-warn-script-location.
Successfully installed pbr-5.11.1 stevedore-4.1.1 virtualenv-clone-0.5.7 virtualenvwrapper-4.8.4

pip in /home/LIST_2080Ti/.local/lib/python3.8/site-packages (22.3.1)

使用:

python -m pip install pypiwin32

报错 

 

$  python -m pip install pypiwin32
Defaulting to user installation because normal site-packages is not writeable
Collecting pypiwin32
  Using cached pypiwin32-223-py3-none-any.whl (1.7 kB)
  Using cached pypiwin32-219.zip (4.8 MB)
  Preparing metadata (setup.py) ... error
  error: subprocess-exited-with-error
  
  × python setup.py egg_info did not run successfully.
  │ exit code: 1
  ╰─> [7 lines of output]
      Traceback (most recent call last):
        File "<string>", line 2, in <module>
        File "<pip-setuptools-caller>", line 34, in <module>
        File "/tmp/pip-install-7pq5lm_i/pypiwin32_ec6fed72462f42b88a11496e25dbe88a/setup.py", line 121
          print "Building pywin32", pywin32_version
                ^
      SyntaxError: Missing parentheses in call to 'print'. Did you mean print("Building pywin32", pywin32_version)?
      [end of output]
  
  note: This error originates from a subprocess, and is likely not a problem with pip.
error: metadata-generation-failed

× Encountered error while generating package metadata.
╰─> See above for output.

note: This is an issue with the package mentioned above, not pip.
hint: See above for details.

进入虚拟环境,直接在bin文件夹处,右键Copy Relative Path

source venv/bin/activate

 

LIST_2080Ti@ubuntu-SYS-7049GP-TRT:~$ source venv/bin/activate
(venv) LIST_2080Ti@ubuntu-SYS-7049GP-TRT:~$ pip3 install -r niejianhao/CHB-MIT-DATA/epilepsy_eeg_classification/requirements.txt 
Collecting appdirs==1.4.4

退出虚拟环境

deactivate

 

pip install -r requirements.txt -i https://pypi.tuna.tsinghua.edu.cn/simple

修改系统环境变量——备注说明 

创建虚拟环境

(mrtrix3) LIST_2080Ti@ubuntu-SYS-7049GP-TRT:~$ virtualenv venvnjh 
created virtual environment CPython3.10.8.final.0-64 in 303ms
  creator CPython3Posix(dest=/home/LIST_2080Ti/venvnjh, clear=False, no_vcs_ignore=False, global=False)
  seeder FromAppData(download=False, pip=bundle, setuptools=bundle, wheel=bundle, via=copy, app_data_dir=/home/LIST_2080Ti/.local/share/virtualenv)
    added seed packages: pip==22.3.1, setuptools==65.6.3, wheel==0.38.4
  activators BashActivator,CShellActivator,FishActivator,NushellActivator,PowerShellActivator,PythonActivator

当我试验了上面的所有方法都没有解决的时候,我只能把需求依赖集合中的pywin32注释掉,然后,问题没有了。

下面的这个讨论帖对于pywin32价值较大,仅供参考。

Could not find a version that satisfies the requirement pywin32>=223 · Issue #1172 · mhammond/pywin32 · GitHub

  • 4
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 4
    评论
当出现"Could not find a version that satisfies the requirement pywin32"的错误时,这通常意味着没有找到与您当前环境兼容的pywin32版本。这可能是由于以下几个原因引起的: 1. 您的Python版本不兼容:请确保您安装的pywin32版本与您当前使用的Python版本兼容。例如,如果您正在使用Python 3.8,您需要安装与Python 3.8兼容的pywin32版本。 2. 依赖项问题:pywin32可能依赖于其他库或工具,而这些库或工具在您的系统上可能不存在或版本不兼容。在安装pywin32之前,您可以尝试更新您的pip工具和其他相关库。 3. 文件名问题:有时候在下载pywin32时,文件名可能包含空格或其他特殊字符,导致无法正确识别和安装。请确保下载的文件名没有任何多余的空格或特殊字符,并使用正确的文件名进行安装。 为了解决这个问题,您可以尝试以下几个步骤: 1. 确认您的Python版本与pywin32的兼容性,并下载适合您Python版本的正确pywin32版本。 2. 更新pip工具和其他相关库,以确保您的环境是最新的,并尝试重新安装pywin32。 3. 如果文件名存在问题,请重新下载正确的pywin32文件并使用正确的文件名进行安装。 总结起来,解决"Could not find a version that satisfies the requirement pywin32"的问题通常需要确保正确的兼容性、更新依赖项和检查文件名是否正确。<span class="em">1</span><span class="em">2</span><span class="em">3</span> #### 引用[.reference_title] - *1* *2* [有关python引用win32api出错的解决办法](https://blog.csdn.net/weixin_45903952/article/details/104054008)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v92^chatsearchT3_1"}}] [.reference_item style="max-width: 50%"] - *3* [scrapy安装py3.7( Could not find a version that satisfies the requirement pywin32-224-cp37-cp37m-win...](https://blog.csdn.net/qq_43680223/article/details/85913875)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v92^chatsearchT3_1"}}] [.reference_item style="max-width: 50%"] [ .reference_list ]
评论 4
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

ACMSunny

赠人玫瑰,手有余香。

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

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

余额充值