本文介绍: 起因是在自己的Mac M1上安装tushare报了这个错,正好环境时间比较长了,于是删除干净从头安装了一遍。Mac M1上从头安装了miniforge3与tushare。2. 编辑~/.zshrc,删除conda相关的初始化脚本。6. 建立conda环境py。

Mac M1上从头安装了miniforge3与tushare。记录一下步骤。

起因是在自己的Mac M1上安装tushare报了这个错,正好环境时间比较长了,于是删除干净从头安装了一遍。

Building wheels for collected packages: lxml
  Building wheel for lxml (setup.py) ... error
  error: subprocess-exited-with-error
  
  × python setup.py bdist_wheel did not run successfully.
  │ exit code: 1
  ╰─> [121 lines of output]
      Building lxml version 5.0.0.
  1. 首先移除上一版miniforge,没有安装过miniforge的朋友请忽略这个步骤。
rm -rf $(conda info --base)

https://blog.csdn.net/qq_39043714/article/details/125019041
2. 编辑~/.zshrc,删除conda相关的初始化脚本

vi ~/.zshrc
  1. 下载miniforge安装包至Downloads
    https://github.com/conda-forge/miniforge
  2. 安装
bash ~/Downloads/Miniforge3-MacOSX-arm64.sh
  1. 重新登录terminal初始化,并添加清华镜像加速包安装
conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/conda-forge/
conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free/
conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/main/
conda config --append channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/fastai/
conda config --append channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/pytorch/
conda config --append channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/bioconda/
conda config --set show_channel_urls yes

https://blog.csdn.net/yhblog/article/details/121629975
6. 建立conda环境py

conda create -n py
conda activate py
  1. 安装numpy和pandas
conda install numpy pandas lxml
  1. 安装tushare
pip install tushare
  1. 验证安装效果
python
import tushare

原文地址:https://blog.csdn.net/gikod/article/details/135375005

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。

如若转载,请注明出处:http://www.7code.cn/show_54354.html

如若内容造成侵权/违法违规/事实不符,请联系代码007邮箱:suwngjj01@126.com进行投诉反馈,一经查实,立即删除!

发表回复

您的电子邮箱地址不会被公开。 必填项已用 * 标注