transpose 使用问题 包的安装使用问题

本文解决了一个在使用pip安装transpose过程中遇到的问题,详细介绍了错误原因及修复步骤,包括如何修改代码以适应不同版本的pip,或者如何降级pip版本。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

安装transpose 出现问题
No module named pip.req

C:\Users\yihe\PycharmProjects\zixue\venv\Scripts>pip install transpose
Collecting transpose
  Using cached https://files.pythonhosted.org/packages/61/54/93f7fbacec4d5b576439a1354e0faae03e1200b
415b4f3be504c0bb454be/transpose-0.4.1.tar.gz
    Complete output from command python setup.py egg_info:
    Traceback (most recent call last):
      File "<string>", line 1, in <module>
      File "C:\Users\yihe\AppData\Local\Temp\pip-install-mgg23pmx\transpose\setup.py", line 3, in <m
odule>
        from pip.req import parse_requirements
    ModuleNotFoundError: No module named 'pip.req'

    ----------------------------------------
Command "python setup.py egg_info" failed with error code 1 in C:\Users\yihe\AppData\Local\Temp\pip-
install-mgg23pmx\transpose\
 

analysis:

This is happening lately because of a change in pip 10.

The fix is pretty easy. You probably have something like:

from pip.req import parse_requirements

Change that to something like:

try: # for pip >= 10
    from pip._internal.req import parse_requirements
except ImportError: # for pip <= 9.0.3
    from pip.req import parse_requirements

如果不知道在哪里更改:则降级pip

I downgraded to pip to 9.0.3 and things worked for me. Command for downgrading pip is

python -m pip install pip==9.0.3

 

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值