简体   繁体   English

Cygwin上的Python3.6无法安装模块

[英]Python3.6 on Cygwin can't install modules

I am trying to run a program on cygwin that uses "import numpy as np" and other modules.我正在尝试在 cygwin 上运行一个程序,该程序使用“import numpy as np”和其他模块。 when I try to compile the program on cygwin (using python3.6) I get an error message that the module is not found enter image description here当我尝试在 cygwin 上编译程序(使用 python3.6)时,我收到一条错误消息,提示找不到模块,请在此处输入图像描述

I have updated my pip3 and when I try to do "pip3 install numpy" i get errors enter image description here我已经更新了我的 pip3,当我尝试执行“pip3 install numpy”时出现错误,请在此处输入图像描述

Numpy is already provided as Cygwin packages, there is no need to install with pip but you need to install with setup. Numpy 已作为 Cygwin 软件包提供,无需使用 pip 安装,但您需要使用 setup 进行安装。 After that在那之后

$ cygcheck -c python36
Cygwin Package Information
Package              Version        Status
python36             3.6.13-1       OK

$ cygcheck -c python36-numpy
Cygwin Package Information
Package              Version        Status
python36-numpy       1.19.4-1       OK

as I have both the two packages:因为我有两个包:

$ python3.6
Python 3.6.13 (default, Feb 16 2021, 07:46:47)
[GCC 10.2.0] on cygwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import numpy as np
>>>

Please note also that the preferred package on cygwin is python 3.8 So same is valid with python38 and python38-numpy另请注意,cygwin 上的首选 package 是 python 3.8 所以同样适用于 python38 和 python38-numpy

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM