amb / blender_pip Goto Github PK
View Code? Open in Web Editor NEWA Blender addon for managing Python modules inside Blender with PIP
License: GNU General Public License v3.0
A Blender addon for managing Python modules inside Blender with PIP
License: GNU General Public License v3.0
a long pip install appears to freeze
with subprocess.popen
we can show live update in the blender addon screen
Under Blender 3.0, the addon panel for Python Module Manager no longer offers the interface for listing/installing/removing modules -- it just shows the basic information (version, description, etc) for the addon, but none of the functional bits. It would be absolutely lovely to see an update to fix this!
(attached a screenshot of the entire panel to show this, though I doubt you'll need it!)
upgrade pip currently installs pip to user folder instead of system folder.
believe this results in 2 pip modules installed. and not on PATH so cant be run from subprocess
['C:\\Program Files\\Blender Foundation\\Blender 3.2\\3.2\\python\\bin\\python.EXE', '-m', 'ensurepip', '--default-pip']
['C:\\Program Files\\Blender Foundation\\Blender 3.2\\3.2\\python\\bin\\python.EXE', '-m', 'pip', 'install', '--upgrade', 'pip']
>>> ERROR
0
WARNING: The scripts pip.exe, pip3.10.exe and pip3.exe are installed in 'C:\Users\user\AppData\Roaming\Python\Python310\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: You are using pip version 21.2.4; however, version 23.1.2 is available.
You should consider upgrading via the 'C:\Program Files\Blender Foundation\Blender 3.2\3.2\python\bin\python.EXE -m pip install --upgrade pip' command.
pip upgrade should detect where pip is installed. and upgrade that one
blender pip installs to user folder in python path
but by default blender ignores the python path, causing the installed module to not be found on startup
i noticed that blender_pip_addon adds site_dir to the path. which solves this issue, but only if this addon is enabled.
in this PR i suggested to remove this behaviour
A better solution would be to install to the blender installation site packages, or at least give the user the option in a setting screen to do so. This will result in a clean install where modules are found as expected, without changing the environment for blender.
From the console when starting Blender 2.93 with Python 3.9:
Blender PIP user site: C:\users....\appdata\roaming\Python\Python39\site-packages
C:\users............\blender_pip_init_.py:36: RuntimeWarning: Use 'sys.executable' instead of 'binary_path_python'! python_bin = bpy.app.binary_path_python
My question is, is this an error connected to Python 3.9 or has this always been there even with Python 3.7 and I'd simply not noticed?
I use the blender_pip to install mlx:
mlx seems to be installed.
But how to actually run this from inside Blender if I need "git pull":
https://github.com/ml-explore/mlx-examples/tree/main/stable_diffusion
I did all the requirements and install the module manually.
https://docs.python.org/3/library/site.html#site.USER_SITE
Path to the user site-packages for the running Python. Can be None if getusersitepackages() hasn’t been called yet.
Can it cause any bugs? May be it is better to use site.getusersitepackages()
?
Starting blender with blender_pip enabled gives the following warning on the console:
/Users/<user>/Library/Application Support/Blender/2.91/scripts/addons/blender_pip/__init__.py:34: RuntimeWarning: Use 'sys.executable' instead of 'binary_path_python'!
Where line 34 is (surprise):
python_bin = bpy.app.binary_path_python
It looks like sys.executable
has existed since roughly the dawn of time, and seems to be correctly set by Blender's internal python, so it shouldn't be harmful to swap out, just to get one fewer warning messages on the blender console.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.