首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >为什么机械化不能通过RPi上的pip正确安装?(python 3.9)

为什么机械化不能通过RPi上的pip正确安装?(python 3.9)
EN

Stack Overflow用户
提问于 2022-06-21 19:22:42
回答 2查看 73关注 0票数 1

我无法成功地在Raspberry Pi (所以,ARM芯片)上安装这个软件包,Debian,python3.9在虚拟环境中。

当我查看virtualenv的sitepackages文件夹时,机械化包实际上只有.dist-info文件,而不是mechanize.py文件或mechanize包文件夹。见下文。

问题:我是不是忽略了什么?

详细信息(1):用pip安装机械

代码语言:javascript
复制
(venvtest) pi@mango:~/MyProject/myproj $ pip --version
pip 20.3.4 from /home/pi/MyProject/myproj/venvtest/lib/python3.9/site-packages/pip (python 3.9)

(venvtest) pi@mango:~/MyProject/myproj $ pip install mechanize
Looking in indexes: https://pypi.org/simple, https://www.piwheels.org/simple
Collecting mechanize
Using cached https://www.piwheels.org/simple/mechanize/mechanize-0.4.8-py2.py3-none-any.whl (5.1 kB)
Requirement already satisfied: html5lib>=0.999999999 in /home/pi/MyProject/myproj/venvtest/lib/python3.9/site-packages (from mechanize) (1.1)
Requirement already satisfied: webencodings in /home/pi/MyProject/myproj/venvtest/lib/python3.9/site-packages (from html5lib>=0.999999999->mechanize) (0.5.1)
Requirement already satisfied: six>=1.9 in /home/pi/MyProject/myproj/venvtest/lib/python3.9/site-packages (from html5lib>=0.999999999->mechanize) (1.16.0)
Installing collected packages: mechanize
Successfully installed mechanize-0.4.8


(venvtest) pi@mango:~/MyProject/myproj $ pip list
Package       Version
------------- -------
html5lib      1.1
mechanize     0.4.8
pip           20.3.4
pkg-resources 0.0.0
setuptools    44.1.1
six           1.16.0
webencodings  0.5.1
wheel         0.34.2

详细信息(2):站点中缺少的包文件夹

代码语言:javascript
复制
(venvtest) pi@mango:~/MyProject/myproj/ $ ls venvtest/lib/python3.9/site-packages
easy_install.py            pip-20.3.4.dist-info            __pycache__                   six.py                        wheel
html5lib                   pip-20.3.4.virtualenv           setuptools                    _virtualenv.pth               wheel-0.34.2.dist-info
html5lib-1.1.dist-info     pkg_resources                   setuptools-44.1.1.dist-info   _virtualenv.py                wheel-0.34.2.virtualenv
mechanize-0.4.8.dist-info  pkg_resources-0.0.0.dist-info   setuptools-44.1.1.virtualenv  webencodings
pip                        pkg_resources-0.0.0.virtualenv  six-1.16.0.dist-info          webencodings-0.5.1.dist-info

Details (3):因此,导入机械化不起作用

代码语言:javascript
复制
(venvtest) pi@mango:~/MyProject/myproj $ python
Python 3.9.2 (default, Mar 12 2021, 04:06:34)
[GCC 10.2.1 20210110] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import mechanize
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
ModuleNotFoundError: No module named 'mechanize'
>>> exit()
EN

回答 2

Stack Overflow用户

回答已采纳

发布于 2022-06-26 10:36:11

这似乎是0.4.8版的一个问题。安装0.4.7版本很好:

代码语言:javascript
复制
pip install mechanize==0.4.7

可以看出:

代码语言:javascript
复制
(venvtest) pi@mango:~/MyProj/myproj $ python
Python 3.9.2 (default, Mar 12 2021, 04:06:34)
[GCC 10.2.1 20210110] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import mechanize
>>> print(mechanize.__version__)
(0, 4, 7, None, None)

我在机器github存储库打开了一张票:https://github.com/python-mechanize/mechanize/issues/76

票数 0
EN

Stack Overflow用户

发布于 2022-06-22 10:05:54

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/72706125

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档