blender pip whl module install issue - python

I have 2 pythons on my computer
One for eclipse and other applications and one for blender.
Computer python version here:
**C:\Users\xxxx\AppData\Local\Programs\Python\Python35-32\Scripts**
Blender (2.79) version is here:
C:\Program Files\Blender Foundation\Blender\2.79\python\bin
I installed pip for Blender (I hope I did) and it is here:
C:\Program Files\Blender Foundation\Blender\2.79\python\lib\site-packages\pip
Then I do this in CMD:
C:\Program Files\Blender Foundation\Blender\2.79\python\lib\site-packages>pip install C:\Users\xxxx\Downloads\pydevd-1.3.2-cp35-cp35m-win32.whl
And get this:
Installing collected packages: pydevd
Found existing installation: pydevd 1.3.0
Uninstalling pydevd-1.3.0:
Successfully uninstalled pydevd-1.3.0
The script pydevd.exe is installed in 'c:\users\xxxx\appdata\local\programs\python\python35-32\Scripts' which is not on PATH.
Consider adding this directory to PATH or, if you prefer to suppress this warning, use --no-warn-script-location.
Successfully installed pydevd-1.3.2
But I get this error still in my script under Blender:
Traceback (most recent call last):
File "C:\Users\emamili\Documents\Posao\modeli\blendtest.blend\Run.py", line 9,
in
pydev.debug(SCRIPT, PYDEVD_PATH)
File "C:\Program Files\Blender Foundation\Blender\pydev_debug.py", line 25, in
debug
import pydevd
ImportError: No module named 'pydevd'
Error: Python script fail, look in the console for now...

Your pip seems to be installing it to:
c:\users\xxxx\appdata\local\programs\python\python35-32\ (which is in your Installing collected packages message).
pip is probably mapping to your pip inside python35-32\scripts\pip.exe and by being inside the blender\site-packages doesn't change that.
Search for your pip.exe inside C:\Program Files\Blender Foundation\Blender\2.79\python or execute the python from blender with python -m pip install pydevd.

Related

Different versions in python and no modules named pip

I put a lot of effort into this and things are even worst I am desperate as hell. Only what I wanted was to download with a pip module called PySimpleGUI and after, that things started to get worse and worse. I program plugins for blender and I wanted to execute another python file as a subprocess that needs PySimpleGUI for its running. So after the first not very successful attempt at solving the pip problem here(Why am I getting ImportError: No module named pip ' right after installing pip?), I decided to delete all the python files and versions on PC and start all over again with installing python. But even though I delete all the python files I still got a message in CMD about my version and that says my version is 3.9.10 although I installed 3.9.7. I removed all paths in env. variables and also all python folders from
C:\Users\UserName\AppData\Local\Programs
C:\Users\UserName\AppData\Roaming
C:\Users\UserName\AppData\Local\Programs
and I think I deleted some folders also here out of desperation
C:\msys64\mingw64
Now if I try to write pip --version to CMD or python3 -m ensurepip (although I have installed python of version 3.9.7) this error occurs.
C:\WINDOWS\system32>"C:\Program Files\Blender Foundation\Blender 3.0\3.0\python\bin\python.exe" -m pip install tkinter -t"C:\Program Files\Blender Foundation\Blender 3.0\3.0\python\lib\site-packages"
C:\Program Files\Blender Foundation\Blender 3.0\3.0\python\bin\python.exe: No module named pip
C:\WINDOWS\system32>python3 -m ensurepip
Could not find platform independent libraries <prefix>
Could not find platform dependent libraries <exec_prefix>
Consider setting $PYTHONHOME to <prefix>[:<exec_prefix>]
Python path configuration:
PYTHONHOME = (not set)
PYTHONPATH = (not set)
program name = 'python3'
isolated = 0
environment = 1
user site = 1
import site = 1
sys._base_executable = 'C:\\msys64\\mingw64\\bin\\python3.exe'
sys.base_prefix = 'D:\\a\\msys64\\mingw64'
sys.base_exec_prefix = 'D:\\a\\msys64\\mingw64'
sys.platlibdir = 'lib'
sys.executable = 'C:\\msys64\\mingw64\\bin\\python3.exe'
sys.prefix = 'D:\\a\\msys64\\mingw64'
sys.exec_prefix = 'D:\\a\\msys64\\mingw64'
sys.path = [
'D:\\a\\msys64\\mingw64\\lib\\python39.zip',
'D:\\a\\msys64\\mingw64\\lib\\python3.9',
'D:\\a\\msys64\\mingw64\\lib\\lib-dynload',
'',
]
Fatal Python error: init_fs_encoding: failed to get the Python codec of the filesystem encoding
Python runtime state: core initialized
ModuleNotFoundError: No module named 'encodings'
Current thread 0x000000b4 (most recent call first):
<no Python frame>
Only what is changing is current thread (Current thread 0x00004604, Current thread 0x00001dec,Current thread 0x00004e18)
I seem to have had a similar problem, it seems to be a problem of mixing up multiple different Python interpreters. Blender has an embedded Python interpreter, this can be seen in your error message
C:\Program Files\Blender Foundation\Blender 3.0\3.0\python\bin\python.exe: No module named pip, this is blender python not having pip, C:\WINDOWS\system32>python3 -m ensurepip is then ran but it's not the same python, here's the python version you installed.
Following this guide has worked for me, the main idea is to
cd C:\Program Files\Blender Foundation\Blender 3.0\3.0\python
As you already attempted you need to run the module ensure pip (but with python blender). So:
.\bin\python.exe - m ensurepip
You can now run
.\Scripts\pip3.exe install PySimpleGUI
or whatever module and it should be accessible from within blender.
for more information (although I'm not sure how still relevant it is) https://blender.stackexchange.com/questions/5287/using-3rd-party-python-modules
I have tried to install pip by installing it using blender python like this:
C:\Program Files\Blender Foundation\Blender 3.0\3.0\python\bin\python.exe -m ensurepip
and then upgrade I upgraded it
C:\Program Files\Blender Foundation\Blender 3.0\3.0\python\bin\python.exe -m pip install --upgrade pip

PyQt5 dependency in a module on Debian [duplicate]

This question already has answers here:
Install PyQt5 5.14.1 on Linux
(8 answers)
Closed 3 years ago.
I have a Python module with a __main__ that uses PyQt5. I've installed PyQt5 on a Debian Buster box:
apt-get install python3-pyqt5
The __main__ program runs as expected if I execute
python3 mymodule/__main__.py
from the source directory. Now I've installed the module into python:
python3 setup.py install
That worked. The setup.py lists a dependency on pyqt5:
setup(
# ...
install_requires=['PyQt5'],
entry_points={"gui_scripts": ["mymodule = mymodule.__main__:main"]},
Setup created a script /usr/local/bin/mymodule. When I run that, I get an error message:
pkg_resources.DistributionNotFound: The 'PyQt5' distribution was not found and is required by mymodule
What am I missing?
EDIT: tried installing pyqt5 via pip, got the following error:
seva#sandbox:~$ sudo pip3 install pyqt5
Collecting pyqt5
Using cached https://files.pythonhosted.org/packages/3a/fb/eb51731f2dc7c22d8e1a63ba88fb702727b324c6352183a32f27f73b8116/PyQt5-5.14.1.tar.gz
Installing build dependencies ... done
Complete output from command python setup.py egg_info:
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "/usr/lib/python3.7/tokenize.py", line 447, in open
buffer = _builtin_open(filename, 'rb')
FileNotFoundError: [Errno 2] No such file or directory: '/tmp/pip-install-26kj5hrc/pyqt5/setup.py'
----------------------------------------
Command "python setup.py egg_info" failed with error code 1 in /tmp/pip-install-26kj5hrc/pyqt5/
OS-level package managers are designed to be consistent within itself. But they aren't designed to interoperate with language package managers. apt-get-installed python3-pyqt5 could be recognized by other Debian packages but not by pip/setuptools.
So either you convert your package to .deb (using stdeb, for example), set dependency to python3-pyqt5 and install it with apt/apt-get/dpkg. Or you install everything using pip:
pip install pyqt5
pip install . # to install your package
If your dependencies are properly declared in the package the latter command should be enough — pip will run the former itself.
PS. Also please consider virtualenv to separate pip-installed packages from system-installed. virtualenv itself could be system-installed or user-installed:
apt install python3-virtualenv
or
pip install [--user] virtualenv

Errors by installing Python modules Pygame and Pygame Zero

I've succesfully installed Python version 3.8.1 and also PIP.
After that i want to install Pygame and Pygame Zero with the commands
pip install pygame
or
pip install pgzero
But I get the following error:
C:\>pip install pygame
Traceback (most recent call last):
File "c:\program files\python38\lib\runpy.py", line 193, in _run_module_as_main
return _run_code(code, main_globals, None,
File "c:\program files\python38\lib\runpy.py", line 86, in _run_code
exec(code, run_globals)
File "C:\Program Files\Python38\Scripts\pip.exe\__main__.py", line 9, in <module>
TypeError: 'module' object is not callable
Also with the --user command it doesn't succeed:
pip install pygame --user
or
pip install pgzero --user
What am I doing wrong here now?
I also got that problem long ago.
You can try this:
pip uninstall pygame
pip uninstall pgzrun
then download it by:
pip install pygame
pip install pgzrun
Info of your assets are little low.. But if you have Python 2 and 3, try manage your alias on CMD by checking your current python variables from /usr/bin and from CMD type "python --version" to see current default. If it says Python2.7 you can chance that with "alias" command below (reason to do that, is 2.7 support is ending 1.1.2020 and old pip for it too. So in future, you should upload new modules just for Python3.7). If you have 2.7 in your PC and you have been using it for some time, you should not try to remove it.
So just in case:
$ alias python="/usr/bin/python3.7"
Then use command
$ sudo pip3 install pygame
This should work. If not, there is some setting problems on your module site.
Give a hit with this and if it doesn't work, let us know. I can give instruction to get it to work. It requires few steps at (in my case:)
/home/usr/Python-3.7.4/Modules/Settings.
It can (I'm not sure with these modules but..) require to set SSL connection too, but it can be done from there too, without any coding.
Thank you for the quick arswers!
It is succeeded by giving the commands:
py -3 -m pip install pygame --user
py -3 -m pip install pgzero --user
The only warnings i got by installing pgzero were:
Collecting pgzero
Downloading .....
Installing collected packages: numpy, pgzero
WARNING: The script f2py.exe is installed in 'C:\Users\Han\AppData\Roaming\Python\Python38\Scripts' which is not on PATH.
Consider adding this directory to PATH or, if you prefer to suppress this warning, use --no-warn-script-location.
WARNING: The script pgzrun.exe is installed in 'C:\Users\Han\AppData\Roaming\Python\Python38\Scripts' which is not on PATH.
Consider adding this directory to PATH or, if you prefer to suppress this warning, use --no-warn-script-location.
Successfully installed numpy-1.18.0 pgzero-1.2
Oh.. I didn't know, you are using Windows.. My last answer dried down with that. It was for Linux.
Either way, when you installed python, did you mark the PATH in installation process?
It shows when installation windows pops up.
I'm little noob with windows, but I expect it to be as same as in any operation systems.
If you didn't, its easier to remove Python and install it again, than try to mark the PATH after installing. After all its just 1/2 min job.

pip install setup.py missing when attemping install of pyodbc wheel file

i'm trying to update the pyodbc package from 4.0.16 to 4.0.22.
i dont have internet access on the machine i'm working on so downloaded the file and copied to across the network.
running
pip install S:\Temp\PMCD\pyodbc-4.0.22-py27hc56fc5f_0(1).tar.bz2
results in the following error:
Processing s:\temp\pmcd\pyodbc-4.0.22-py27hc56fc5f_0(1).tar.bz2
Complete output from command python setup.py egg_info:
Traceback (most recent call last):
File "<string>", line 1, in <module>
IOError: [Errno 2] No such file or directory: 'c:\\users\\adm_pa~2\\appdata\\local\\temp\\2\\pip-yf25bd-build\\setup.py'
----------------------------------------
Command "python setup.py egg_info" failed with error code 1 in c:\users\adm_pa~2\appdata\local\temp\2\pip-yf25bd-build\
setuptools has already been updated to latest(38.5.1) and pip as well (9.0.1)
i used pip to update setuptools and pip itself (via downloaded whl files), so i dont think pip is an issue.
i already managed to sucessfully upgrade pyodbc on my local machine from 16 to 22, so the whl file i have not sure whats going on.
Any ideas whats going on?
Could i manually unzip the package and place it directly in the site-packages? that didnt seem to do anything.
If your target machine does not have a direct Internet connection you can still install pyodbc by
using another machine to download the appropriate wheel (.whl) file from PyPI,
copying that file to your target machine (via LAN, SneakerNet, ...), and
using pip install <wheel_file_location>
For example,
pip install C:\__tmp\pyodbc-4.0.22-cp27-cp27m-win_amd64.whl
The naming convention for wheel files is described in PEP 491.
The 64-bit wheel files for Windows are tagged as "win_amd64" because that's what the Windows version of distutils reports as the platform:
>>> from distutils import util
>>> distutils.util.get_platform()
'win-amd64'

How do I solve the issue "No module name Botan"

I am using windows 8 and python 3.6.1 I've done the following command in my cmd:
pip install cryptoshop
However, when I run the following python code:
from cryptoshop import encryptfile
from cryptoshop import decryptfile
result1 = encryptfile(filename="test", passphrase="mypassphrase", algo="srp")
print(result1)
result2 = decryptfile(filename="test.cryptoshop", passphrase="mypassphrase")
print(result2)
I get the following error:
Traceback (most recent call last):
File "C:/Users/Owner/Desktop/test.py", line 1, in
from cryptoshop import encryptfile
File "C:\Users\Owner\AppData\Local\Programs\Python\Python36-32\lib\site-packages\cryptoshop__init__.py", line 26, in
from cryptoshop.cryptoshop import encryptfile
File "C:\Users\Owner\AppData\Local\Programs\Python\Python36-32\lib\site-packages\cryptoshop\cryptoshop.py", line 56, in
from ._cascade_engine import encry_decry_cascade
File "C:\Users\Owner\AppData\Local\Programs\Python\Python36-32\lib\site-packages\cryptoshop_cascade_engine.py", line 27, in
from ._nonce_engine import generate_nonce_timestamp
File "C:\Users\Owner\AppData\Local\Programs\Python\Python36-32\lib\site-packages\cryptoshop_nonce_engine.py", line 39, in
import botan
ModuleNotFoundError: No module named 'botan'
Now, I obviously know that you must install botan into python in order to use it. However, this is where I am running into an issue. I've downloaded Botan from this link as instructed:
https://github.com/randombit/botan
And then I've followed these instructions in an attempt to install Botan:
./configure.py [--prefix=/some/directory]
make
make install
However, when I type make into the command line I get an error saying there is no such command. And then when I go to run my above Python code I still get the no module Botan error. So obviously I am doing something run. How can I properly install Botan into my Python 3.6 directories so that I can use cryptoshop.
I've also attempted to do pip install Botan, as that is how I've installed so many other python libraries but that has been unsuccessful as well.
make is a linux command
According to the botan website you can use nmake as a replacement on windows ( http://wiki.c2.com/?UsingNmake ) :
On Windows
You need to have a copy of Python installed, and have both Python and
your chosen compiler in your path. Open a command shell (or the SDK
shell), and run:
$ python configure.py --cc=msvc (or --cc=gcc for MinGW) [--cpu=CPU]
$ nmake
$ botan-test.exe
$ nmake install
Botan supports the nmake replacement Jom which enables you to run
multiple build jobs in parallel.
source : https://botan.randombit.net/manual/building.html
For completeness, here's how I made it work on a Mac
Assuming you have brew installed.
brew install botan
You may need to install other functionality first:
brew install gmp
brew install mpfr
brew install mpc
Find out where botan got installed with brew info botan.
My location is /usr/local/Cellar/botan/2.6.0
In that folder, you'll find lib/python2.7/site-packages, copy the contents of this folder into your Python's installation site-packages folder.
Note 1: At the time of this writing, only python 2.7 seems to be supported, but I'm using python 3.6 and everything seems to be working.
Note 2: If the file is called botan2.py, you may need to rename it to botan.py in your python's site-packages folder.

Categories