无法安装重采样

如何解决无法安装重采样

Ubuntu 20.04.2 我在 virtualenv 中使用 python2.7(因为我试图构建的程序不适用于我的 3.8) 点子 20.3.4

我试图运行的程序(涉及 tensorflow)附带了一个包含所有需要安装的东西的文件(我认为这是一个 dockerfile?)。当我尝试运行该程序时,我收到有关 dockerfile 中的一项的错误 -- resampy。

我得到一个 ImportError:No module resampy

我做了一个pip install resampy

DEPRECATION: Python 2.7 reached the end of its life on January 1st,2020. Please upgrade your Python as Python 2.7 is no longer maintained. pip 21.0 will drop support for Python 2.7 in January 2021. More details about Python 2 support in pip can be found at https://pip.pypa.io/en/latest/development/release-process/#python-2-support pip 21.0 will remove support for this functionality.
Processing /home/pete/.cache/pip/wheels/19/90/bb/f45e7cc1cfc8f5299c12511fccefcca90c801de995a4e7eb00/resampy-0.2.2-py2-none-any.whl
Collecting numba>=0.32
  Using cached numba-0.47.0-cp27-cp27mu-manylinux1_x86_64.whl (3.6 MB)
Requirement already satisfied: numpy>=1.10 in /home/pete/env/py2.7/lib/python2.7/site-packages (from resampy) (1.13.1)
Requirement already satisfied: scipy>=0.13 in /home/pete/env/py2.7/lib/python2.7/site-packages (from resampy) (0.19.1)
Requirement already satisfied: six>=1.3 in /home/pete/env/py2.7/lib/python2.7/site-packages (from resampy) (1.11.0)
Requirement already satisfied: singledispatch; python_version < "3.4" in /home/pete/env/py2.7/lib/python2.7/site-packages (from numba>=0.32->resampy) (3.4.0.3)
Collecting llvmlite>=0.31.0dev0
  Using cached llvmlite-0.32.1.tar.gz (104 kB)
Requirement already satisfied: setuptools in /home/pete/env/py2.7/lib/python2.7/site-packages (from numba>=0.32->resampy) (44.1.1)
Requirement already satisfied: funcsigs; python_version < "3.3" in /home/pete/env/py2.7/lib/python2.7/site-packages (from numba>=0.32->resampy) (1.0.2)
Requirement already satisfied: enum34; python_version < "3.4" in /home/pete/env/py2.7/lib/python2.7/site-packages (from numba>=0.32->resampy) (1.1.10)
Building wheels for collected packages: llvmlite
  Building wheel for llvmlite (setup.py) ... error
  ERROR: Command errored out with exit status 1:
   command: /home/pete/env/py2.7/bin/python -u -c 'import sys,setuptools,tokenize; sys.argv[0] = '"'"'/tmp/pip-install-UP2Yh4/llvmlite/setup.py'"'"'; __file__='"'"'/tmp/pip-install-UP2Yh4/llvmlite/setup.py'"'"';f=getattr(tokenize,'"'"'open'"'"',open)(__file__);code=f.read().replace('"'"'\r\n'"'"','"'"'\n'"'"');f.close();exec(compile(code,__file__,'"'"'exec'"'"'))' bdist_wheel -d /tmp/pip-wheel-ZIPpvD
       cwd: /tmp/pip-install-UP2Yh4/llvmlite/
  Complete output (7 lines):
  running bdist_wheel
  /home/pete/env/py2.7/bin/python /tmp/pip-install-UP2Yh4/llvmlite/ffi/build.py
    File "/tmp/pip-install-UP2Yh4/llvmlite/ffi/build.py",line 122
      raise ValueError(msg.format(_ver_check_skip)) from e
                                                       ^
  SyntaxError: invalid syntax
  error: command '/home/pete/env/py2.7/bin/python' failed with exit status 1
  ----------------------------------------
  ERROR: Failed building wheel for llvmlite
  Running setup.py clean for llvmlite
Failed to build llvmlite
Installing collected packages: llvmlite,numba,resampy
    Running setup.py install for llvmlite ... error
    ERROR: Command errored out with exit status 1:
     command: /home/pete/env/py2.7/bin/python -u -c 'import sys,'"'"'exec'"'"'))' install --record /tmp/pip-record-j9jtLs/install-record.txt --single-version-externally-managed --compile --install-headers /home/pete/env/py2.7/include/site/python2.7/llvmlite
         cwd: /tmp/pip-install-UP2Yh4/llvmlite/
    Complete output (10 lines):
    running install
    running build
    got version from file /tmp/pip-install-UP2Yh4/llvmlite/llvmlite/_version.py {'version': '0.32.1','full': 'aa11b129c0b55973067422397821ae6d44fa5e70'}
    running build_ext
    /home/pete/env/py2.7/bin/python /tmp/pip-install-UP2Yh4/llvmlite/ffi/build.py
      File "/tmp/pip-install-UP2Yh4/llvmlite/ffi/build.py",line 122
        raise ValueError(msg.format(_ver_check_skip)) from e
                                                         ^
    SyntaxError: invalid syntax
    error: command '/home/pete/env/py2.7/bin/python' failed with exit status 1
    ----------------------------------------
ERROR: Command errored out with exit status 1: /home/pete/env/py2.7/bin/python -u -c 'import sys,'"'"'exec'"'"'))' install --record /tmp/pip-record-j9jtLs/install-record.txt --single-version-externally-managed --compile --install-headers /home/pete/env/py2.7/include/site/python2.7/llvmlite Check the logs for full command output.

我尝试了 pip3 install resampy,结果看起来更好:

Defaulting to user installation because normal site-packages is not writeable
Requirement already satisfied: resampy in /usr/local/lib/python3.8/dist-packages (0.2.2)
Requirement already satisfied: numba>=0.32 in /usr/local/lib/python3.8/dist-packages (from resampy) (0.52.0)
Requirement already satisfied: scipy>=0.13 in /usr/local/lib/python3.8/dist-packages (from resampy) (1.6.0)
Requirement already satisfied: numpy>=1.10 in /home/pete/.local/lib/python3.8/site-packages (from resampy) (1.19.4)
Requirement already satisfied: six>=1.3 in /usr/lib/python3/dist-packages (from resampy) (1.14.0)
Requirement already satisfied: setuptools in /usr/lib/python3/dist-packages (from numba>=0.32->resampy) (45.2.0)
Requirement already satisfied: llvmlite<0.36,>=0.35.0 in /usr/local/lib/python3.8/dist-packages (from numba>=0.32->resampy) (0.35.0)
WARNING: You are using pip version 20.3.3; however,version 21.0.1 is available.
You should consider upgrading via the '/usr/bin/python3 -m pip install --upgrade pip' command.

没有错误。但是当我尝试运行我试图运行的程序时,我仍然得到原始的 ImportError

我承认我在这里过头了。我基本上只有中等水平的 Python 知识/经验。我什至不知道“轮子”是什么,我在里面找不到任何东西,因为“轮子”在谷歌上很难找到关于轮胎之类的东西。因此,即使只是了解“轮子”是什么的指针也会有所帮助。

谢谢!

解决方法

我之前试过py27安装也失败了。

但是你可以通过 py38 安装它

pip install resampy

你可以测试一下

pip install -e .[tests]
pip install pytest pytest-cov pytest-faulthandler
py.test --cov-report term-missing --cov resampy

结果: enter image description here

至于ImportError,一旦你成功安装它,它对我来说效果很好: enter image description here

,

不妨试试这个

pip install llvmlite==0.31.0

pip install resampy

就我而言,当前的 llvmlite 软件包版本使其崩溃。但是resampy需要这个包。

您也可以尝试早期版本的 resampy,它独立于 llvmlite

pip install resampy==0.1.5

祝你好运

版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。

相关推荐


使用本地python环境可以成功执行 import pandas as pd import matplotlib.pyplot as plt # 设置字体 plt.rcParams[&#39;font.sans-serif&#39;] = [&#39;SimHei&#39;] # 能正确显示负号 p
错误1:Request method ‘DELETE‘ not supported 错误还原:controller层有一个接口,访问该接口时报错:Request method ‘DELETE‘ not supported 错误原因:没有接收到前端传入的参数,修改为如下 参考 错误2:cannot r
错误1:启动docker镜像时报错:Error response from daemon: driver failed programming external connectivity on endpoint quirky_allen 解决方法:重启docker -&gt; systemctl r
错误1:private field ‘xxx‘ is never assigned 按Altʾnter快捷键,选择第2项 参考:https://blog.csdn.net/shi_hong_fei_hei/article/details/88814070 错误2:启动时报错,不能找到主启动类 #
报错如下,通过源不能下载,最后警告pip需升级版本 Requirement already satisfied: pip in c:\users\ychen\appdata\local\programs\python\python310\lib\site-packages (22.0.4) Coll
错误1:maven打包报错 错误还原:使用maven打包项目时报错如下 [ERROR] Failed to execute goal org.apache.maven.plugins:maven-resources-plugin:3.2.0:resources (default-resources)
错误1:服务调用时报错 服务消费者模块assess通过openFeign调用服务提供者模块hires 如下为服务提供者模块hires的控制层接口 @RestController @RequestMapping(&quot;/hires&quot;) public class FeignControl
错误1:运行项目后报如下错误 解决方案 报错2:Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.8.1:compile (default-compile) on project sb 解决方案:在pom.
参考 错误原因 过滤器或拦截器在生效时,redisTemplate还没有注入 解决方案:在注入容器时就生效 @Component //项目运行时就注入Spring容器 public class RedisBean { @Resource private RedisTemplate&lt;String
使用vite构建项目报错 C:\Users\ychen\work&gt;npm init @vitejs/app @vitejs/create-app is deprecated, use npm init vite instead C:\Users\ychen\AppData\Local\npm-
参考1 参考2 解决方案 # 点击安装源 协议选择 http:// 路径填写 mirrors.aliyun.com/centos/8.3.2011/BaseOS/x86_64/os URL类型 软件库URL 其他路径 # 版本 7 mirrors.aliyun.com/centos/7/os/x86
报错1 [root@slave1 data_mocker]# kafka-console-consumer.sh --bootstrap-server slave1:9092 --topic topic_db [2023-12-19 18:31:12,770] WARN [Consumer clie
错误1 # 重写数据 hive (edu)&gt; insert overwrite table dwd_trade_cart_add_inc &gt; select data.id, &gt; data.user_id, &gt; data.course_id, &gt; date_format(
错误1 hive (edu)&gt; insert into huanhuan values(1,&#39;haoge&#39;); Query ID = root_20240110071417_fe1517ad-3607-41f4-bdcf-d00b98ac443e Total jobs = 1
报错1:执行到如下就不执行了,没有显示Successfully registered new MBean. [root@slave1 bin]# /usr/local/software/flume-1.9.0/bin/flume-ng agent -n a1 -c /usr/local/softwa
虚拟及没有启动任何服务器查看jps会显示jps,如果没有显示任何东西 [root@slave2 ~]# jps 9647 Jps 解决方案 # 进入/tmp查看 [root@slave1 dfs]# cd /tmp [root@slave1 tmp]# ll 总用量 48 drwxr-xr-x. 2
报错1 hive&gt; show databases; OK Failed with exception java.io.IOException:java.lang.RuntimeException: Error in configuring object Time taken: 0.474 se
报错1 [root@localhost ~]# vim -bash: vim: 未找到命令 安装vim yum -y install vim* # 查看是否安装成功 [root@hadoop01 hadoop]# rpm -qa |grep vim vim-X11-7.4.629-8.el7_9.x
修改hadoop配置 vi /usr/local/software/hadoop-2.9.2/etc/hadoop/yarn-site.xml # 添加如下 &lt;configuration&gt; &lt;property&gt; &lt;name&gt;yarn.nodemanager.res