当前位置:   article > 正文

ERROR: Package ‘numpy‘ requires a different Python: 2.7.17 not in ‘>=3.8‘_error: package 'visdom' requires a different pytho

error: package 'visdom' requires a different python: 3.7.16 not in '>=3.8

安装numpy

pip install numpy

报错

ERROR: Package 'numpy' requires a different Python: 2.7.17 not in '>=3.8'

解决方案:

指定版本即可:

sudo pip install numpy==1.20.3
  1. rosbag play xx.bag
  2. bash: /opt/ros/melodic/bin/rosbag: /usr/bin/python2: 解释器错误: 没有那个文件或目录

解决方法:

  1. python
  2. Python 2.7.17 (default, Mar 8 2023, 18:40:28)
  3. [GCC 7.5.0] on linux2
  4. Type "help", "copyright", "credits" or "license" for more information.
  5. >>> ls
  6. Traceback (most recent call last):
  7. File "<stdin>", line 1, in <module>
  8. NameError: name 'ls' is not defined
  9. >>> import sys
  10. >>> sys.path
  11. ['', '/home/ubuntu/ws_livox1/devel/lib/python2.7/dist-packages', '/home/ubuntu/ws_livox/devel/lib/python2.7/dist-packages', '/opt/ros/melodic/lib/python2.7/dist-packages', '/usr/lib/python2.7', '/usr/lib/python2.7/plat-x86_64-linux-gnu', '/usr/lib/python2.7/lib-tk', '/usr/lib/python2.7/lib-old', '/usr/lib/python2.7/lib-dynload', '/home/ubuntu/.local/lib/python2.7/site-packages', '/usr/lib/python2.7/dist-packages', '/usr/lib/python2.7/dist-packages/wx-3.0-gtk3']

按Ctrl+D

找到这个位置

/usr/lib/python2.7

重新建立软链接

  1. sudo ln -s /usr/bin/python2 /usr/bin/python
  2. sudo ln -s /usr/bin/python2.7 /usr/bin/python2

声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/weixin_40725706/article/detail/570131
推荐阅读
相关标签
  

闽ICP备14008679号