简体   繁体   English

在 Thonny(Python 文本编辑器)中安装模块的问题

[英]Issue to installing module in Thonny (Python text editor)

I downloaded Thonny (which is a text editor for python) for using my Raspberry Pi Pico, and I tried to install a module in "Manage packages" , when I began the installation, this error line code appeared:我下载了 Thonny(这是一个 python 的文本编辑器)来使用我的 Raspberry Pi Pico,我试图在“管理包”中安装一个模块,当我开始安装时,出现了这个错误行代码:

ERROR: Can not combine '--user' and '--target'
Process returned with code 1

Fortunately there is another way to install modules and I tried it:幸运的是还有另一种安装模块的方法,我试过了:

Install from a local file : I installed the package in cmd pip install Adafruit-SSD1306 in target directory of the Thonny's modules C:\Users\33631\AppData\Roaming\Python\Python310\site-packages , but I still don't see the module I installed.从本地文件安装:我在 Thonny 模块的目标目录C:\Users\33631\AppData\Roaming\Python\Python310\site-packages的 cmd pip install Adafruit-SSD1306中安装了这个包,但我仍然看不到我安装的模块。

After that, I figured out I can't install modules at all, and it brings me the same error message.在那之后,我发现我根本无法安装模块,它给我带来了同样的错误信息。

这是错误

I use:我用:

  • Python version: 3.10蟒蛇版本:3.10
  • Pip version: 22.3点版本:22.3
  • Thonny version: 4.0.1棘手的版本:4.0.1

I tried many things, change the directory, install with the cmd and research with the Install from a local file , but it is still not working.我尝试了很多东西,更改目录,使用 cmd 安装并使用Install from a local file 进行研究,但它仍然无法正常工作。

I use also the Thonny editor several years, but have never used his Tool | Manage packages...我也使用Thonny 编辑器好几年了,但从未使用过他的Tool | Manage packages... Tool | Manage packages... function. Tool | Manage packages...功能。 I use always pip install... instead.我总是使用pip install...代替。

If you open this dialog, it shows you a Target path something like C:\Users\your_user\AppData\Roaming\Python\Python311\site-packages , depending on your phython version and path.如果您打开此对话框,它会向您显示类似于C:\Users\your_user\AppData\Roaming\Python\Python311\site-packages目标路径,具体取决于您的 phython 版本和路径。 I assume that python packages are installed always under the phython directory like C:\Python311\Lib\site-packages .我假设 python 包总是安装在 phython 目录下,比如C:\Python311\Lib\site-packages My Thonny editor is olso there.我的Thonny 编辑器也在那里。 Have you searched into python site-packages directory, too?您是否也搜索过 python 站点包目录?

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

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