Issue to installing module in Thonny (Python text editor) - python

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:
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.
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
Pip version: 22.3
Thonny version: 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.

I use also the Thonny editor several years, but have never used his Tool | Manage packages... function. I use always pip install ... instead.
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. I assume that python packages are installed always under the phython directory like C:\Python311\Lib\site-packages. My Thonny editor is olso there. Have you searched into python site-packages directory, too?

Related

Spyder can't find installed modules with pip

I first installed Spyder and then afterwards Python on a server (with Windows Server 2019) all on the directory "C:\Users\wi932\ .spyder-py3" and the Python folder "C:\Users\wi932\Python\Python38". Then I installed many packages (like tensorflow, matplotlib, scikitlearn) by using the command prompt of windows and pip from the directory "C:\Users\wi932\Python\Python38\Scripts" and it was okay.
However, when running Spyder I can't use the packages that I installed using pip. Whenever I run a Python programm with those modules I get an error message "ModuleNotFoundError: No module named 'tensorflow'". So the question is how can I build a "connection" between the pip and Spyder?
Does anyone have an idea? I'll appreciate every comment.
Have you considered installing anaconda?
Spyder comes as a part of this and is easy to install from the anaconda client. You can also create your base environment in the anaconda client and then switch to pip to install packages from there.

Python 3.5.1 Pygame Installation

I am trying to install Pygame for Python 3.5.1, but it tells me to upgrade to the new version of pip. "You are currently using 7.1.2, use 8.1.2".
Here is a screen shot of it:
The error clearly states Access Denied.
Try to run cmd/powershell as administrator.
The installation error is not because of pip , though you should still upgrade pip
python -m pip install --upgrade pip
Pygame does not have python3.5 support yet. Check the binaries here
Pygame binaries
Try to use Python version 3.4 or 2.7 and then install pygame.
EDIT
You can find unofficial pygame binaries for several Python versions including Python3.5 here.
So if you do not find the official binary, you could try the appropriate file from the above link.
Note: The binaries given there are whl files. So you need to install them using pip.
Example: Assuming you have 32-bit Python installation, run pip install pygame-1.9.2b1-cp35-cp35m-win32.whl
See this answer for more detailed instructions.
Pip seems to be having a permission problem creating this directory: c:\program files (x86)\python35-32\Lib\site-packages\pygame
Here are some things you can try:
Navigate to that directory and see if it already exists. If it does exist, then try deleting it.
Try running pip as an administrator. Right click the command prompt icon and select run as administrator. Your path variables might not be set for the administrator, so you many need to give the full path for pip. In your python folder, it should be in a folder called scripts.
Since you're using Windows, you can also try the binary installers here: http://www.pygame.org/download.shtml
If nothing works you can try installing a different version of Python. I use Python 2.7.8 with pygame.
It was a problem based on the admin command run program and I figures it out.

pycharm interpreter using cygwin version python

I am running django python2.7 using Pycharm in windows.
Now I have some issue with redis queue not working in windows because of this
I am trying to do what this person did here. Use a cygwin version of python as pycharm interpreter.
(not sure if I downloaded all the packages or did correct steps)
I downloaded cygwin and install packages python2.7 + python-setuptools and then try to point my Pycharm interpreter to c:/cygwin/bin/python27.exe
see image
After that it seem ok and ask me to install packing tools pip, I clicked it and it give me this error:
see image
"Cannot start process, the working directory '\cygdrive\c\Users\User1G~1.SIS\AppData\Local\Temp\1\tmpYpudf2pycharm-management\pip-7.1.0' does not exist"
According to the error message it looks like pip can't be found... Are you sure you have installed pip?
Take a look here, how you can install pip: Installing Pip-3.2 on Cygwin
You can open a cygwin command line window and try to manually install the packages you want to.

How to start using `scipy`

I have previously installed Python 3.4.2 and 3.5.2 and in both cases I can dabble in writing and testing code in Idle which gives me two windows -- a "Run" window for code, and a "Shell" window for interaction and output (sorry, not sure of the correct terminology).
Now I'd like to try out scipy, particularly scipy.spatial.
First, I downloaded WinPython (WinPython-64bit-3.4.3.6Qt5.exe) from sourceforge.net/projects/winpython/files/ but when I tried to install it, it wanted to put it in my Downloads folder (where the installer was saved, obviously) so I browsed to Program Files and tried to install there but I get
Error opening file for writing
C:\Program Files\WinPython-64bit-3.4.3\IDLE (Python GUI).exe
Same response at C:\Program Files (x86)\.
Next, I downloaded just scipy-0.16.1-win32-superpack-python3.4.exe and it seemed to be successfully installed until I try to run import scipy in my usual "Run" window I get
ImportError: No module named 'numpy'.
Third, I retried WinPython-64bit-3.4.3.6Qt5.exe again, but this time accepting the default Downloads install location. This time there was a successful installation of python-3.5.1.exe in Downloads. When I ran it I chose "Repair" and eventually got "Repair was sucessful." However, when I try to run import scipy in my usual "Run" window I get
ImportError: No module named 'scipy'.
What steps am I missing? What is the easiest way for me to try using scipy?
Assuming you have correctly installed Python, you can try using the .whl (wheel) files available on the LFD's website.
First, make sure you have an updated version of pip which supports the use of .whl files by using the following command in the terminal:
python -m pip install -U pip
Then, download the latest versions of the .whl files for NumPy and SciPy into some directory you can easily locate.
Afterwards, use the following command to install the .whl files you've downloaded in the necessary order:
python -m pip install C:/path/name-of-file.whl

Python3.3 can't find libpython3.3m.so in linux (pip-3.3)

I'm using ubuntu 12.10 with default python3.2. However I downloaded python 3.3 as its much more polished. Of course, since then I have a nightmare with installing modules for 3.3, as python3 packages from synaptic install to 3.2 dir. So, I installed pip using python 3.3. Now I have pip-3.3 command, great. But, when I tried "sudo pip-3.3 install PySide" I quickly got an error: "error: Failed to locate the Python library /usr/lib/libpython3.3m.so". What's more, when I run "sudo pip install PySide" (command for 2.7), it builded and installed and runs flawlessy. Pyvenv and virtualenv both fail too. But I wan't to do it non-env way,just install pyside to global 3.3 lib dir.
So how can I install that PySide to python 3.3? I just can't get it to work... It looks like I will have to stick with default ubuntu python 3 version (this one runs great, everything works both from pip and synaptic), but I like to use newest python as it gets better and better with every release.
Btw, if that matters I also got following warning before that error:
"package init file 'PySide/init.py' not found (or not a regular file)" and
"package init file 'pysideuic/init.py' not found (or not a regular file)"
Edit: I installed full python3.3 from synaptic, including pythoh3.3-dev, debug, lib etc. Everything.
And that dynamic python 3.3 lib exist in /usr/lib/x86_64-linux-gnu/libpython3.3m.so, maybe just python3.3 package for ubuntu is poor and installs it in wrong direction/doesn't do any symlinks tricks?
Please try this answer installing from source (PySide). Download pyside sources and install from source, follow the instructions on the link.

Categories

Resources