V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
推荐学习书目
Learn Python the Hard Way
Python Sites
PyPI - Python Package Index
http://diveintopython.org/toc/index.html
Pocoo
值得关注的项目
PyPy
Celery
Jinja2
Read the Docs
gevent
pyenv
virtualenv
Stackless Python
Beautiful Soup
结巴中文分词
Green Unicorn
Sentry
Shovel
Pyflakes
pytest
Python 编程
pep8 Checker
Styles
PEP 8
Google Python Style Guide
Code Style from The Hitchhiker's Guide
746970179
V2EX  ›  Python

m1 下如何安装 python2.7 的 numpy

  •  
  •   746970179 · 2022-11-25 16:51:05 +08:00 · 2512 次点击
    这是一个创建于 489 天前的主题,其中的信息可能已经有所发展或是发生改变。

    描述: macbook air m1 pyenv 创建的 python2.7.18 虚拟环境 在 pip install numpy 时报错, google 了很久, 结果都是 python3 的解决方案

    如果使用 pyenv 创建 python3 的虚拟环境, 安装很顺利 但是项目是历史遗留的, 是 python2.7 的版本

    目前想到的方案, 是使用 docker 想问下是否有直接安装的方案

    6 条回复    2022-11-28 15:13:28 +08:00
    ysc3839
        1
    ysc3839  
       2022-11-25 17:08:14 +08:00
    没装编译工具链?先装上试试?还是报错的话估计是不支持 ARM 架构。
    BingoXuan
        2
    BingoXuan  
       2022-11-25 17:10:50 +08:00
    docker 有 python2.7 的镜像,pull 下来后可以试一下用 apt 安装。但跨架构就不知道好不好用。反正我用 x86 的 podman 用 qemu 跑 armv7l 的 python2.7 完全没问题。但 m1 的 colima 就不行
    ruanimal
        3
    ruanimal  
       2022-11-26 15:39:50 +08:00
    感觉你改造一下代码升级到 python3 ,更快
    tofuliang
        4
    tofuliang  
       2022-11-26 17:16:51 +08:00   ❤️ 1
    可以直接用 x86 架构的 python2,官网有安装包的
    Kobayashi
        5
    Kobayashi  
       2022-11-27 03:14:48 +08:00   ❤️ 1
    ❯ uname -sm
    Darwin arm64

    ❯ python
    Python 2.7.18 (default, Mar 29 2022, 07:33:40)
    [GCC Apple LLVM 13.1.6 (clang-1316.0.21.2)] on darwin
    Type "help", "copyright", "credits" or "license" for more information.
    >>> import numpy as np
    >>> a = np.arange(15).reshape(3, 5)
    >>> a
    array([[ 0, 1, 2, 3, 4],
    [ 5, 6, 7, 8, 9],
    [10, 11, 12, 13, 14]])
    >>>
    746970179
        6
    746970179  
    OP
       2022-11-28 15:13:28 +08:00
    @Kobayashi 厉害了, 我这里 pip install 安装的时候, 报了一堆错误, 也看不懂,,::>_<::
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   我们的愿景   ·   实用小工具   ·   1093 人在线   最高记录 6543   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 26ms · UTC 18:53 · PVG 02:53 · LAX 11:53 · JFK 14:53
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.