解决使用pip安装时找不到合适的包的版本

1.ubuntu python 优先级设置
ubuntu升级python3.5至3.6及软件与更新打不开问题解决

2.使用pip安装时找不到合适的版本

ERROR: Could not find a version that satisfies the requirement etw-pytorch-utils (unavailable) (from versions: none)
ERROR: No matching distribution found for etw-pytorch-utils (unavailable)

解决使用pip安装时找不到合适的包的版本_第1张图片
安装的是开源算法提供的requirements.txt环境,发现是无法打开github地址
因此替换找到了一个可以打开的镜像,然后就安装成功了!

git+git://github.com/erikwijmans/etw_pytorch_utils.git@v1.1.1#egg=etw_pytorch_utils

git+https://github.com/peter0749/etw_pytorch_utils.git#egg=etw_pytorch_utils

3.torch版本问题导致索引错误

Traceback (most recent call last):
  File "setup.py", line 38, in <module>
    cmdclass={"build_ext": BuildExtension},
  File "/usr/lib/python3.6/distutils/core.py", line 148, in setup
    dist.run_commands()
  File "/usr/lib/python3.6/distutils/dist.py", line 955, in run_commands
    self.run_command(cmd)
  File "/usr/lib/python3.6/distutils/dist.py", line 974, in run_command
    cmd_obj.run()
  File "/usr/lib/python3/dist-packages/setuptools/command/build_ext.py", line 49, in run
    _build_ext.run(self)
  File "/home/like/.local/lib/python3.6/site-packages/Cython/Distutils/old_build_ext.py", line 186, in run
    _build_ext.build_ext.run(self)
  File "/usr/lib/python3.6/distutils/command/build_ext.py", line 339, in run
    self.build_extensions()
  File "/home/like/.local/lib/python3.6/site-packages/torch/utils/cpp_extension.py", line 709, in build_extensions
    build_ext.build_extensions(self)
  File "/home/like/.local/lib/python3.6/site-packages/Cython/Distutils/old_build_ext.py", line 195, in build_extensions
    _build_ext.build_ext.build_extensions(self)
  File "/usr/lib/python3.6/distutils/command/build_ext.py", line 448, in build_extensions
    self._build_extensions_serial()
  File "/usr/lib/python3.6/distutils/command/build_ext.py", line 473, in _build_extensions_serial
    self.build_extension(ext)
  File "/usr/lib/python3/dist-packages/setuptools/command/build_ext.py", line 174, in build_extension
    _build_ext.build_extension(self, ext)
  File "/usr/lib/python3.6/distutils/command/build_ext.py", line 533, in build_extension
    depends=ext.depends)
  File "/usr/lib/python3.6/distutils/ccompiler.py", line 574, in compile
    self._compile(obj, src, ext, cc_args, extra_postargs, pp_opts)
  File "/home/like/.local/lib/python3.6/site-packages/torch/utils/cpp_extension.py", line 457, in unix_wrap_single_compile
    cflags = unix_cuda_flags(cflags)
  File "/home/like/.local/lib/python3.6/site-packages/torch/utils/cpp_extension.py", line 424, in unix_cuda_flags
    cflags + _get_cuda_arch_flags(cflags))
  File "/home/like/.local/lib/python3.6/site-packages/torch/utils/cpp_extension.py", line 1562, in _get_cuda_arch_flags
    arch_list[-1] += '+PTX'
IndexError: list index out of range

解决办法:卸载torch1.9版本,更换为1.5
官方地址:https://pytorch.org/

pip uninstall torch

pip3 install torch===1.5.1 torchvision===0.6.1 

你可能感兴趣的:(ubuntu,Python,python)