0

I'm trying to install modules (one of them is open3d) with pip command.
From 2.8+ it should be easy as pip install open3d (mentioned here or here), but ...

cd /.../Blender\ 92.app/Contents/Resources/2.92/python/bin
python3.7m -m pip install open3d

results with Terminal report

zsh: command not found: python3.7m

The last one thread I found was a notification - pip is installed from 2.8+ for Win, but not for Linux/Mac builds. So I wanted to install pip with ensurepip as mentioned here ... into Blender's bin folder (where python3.7 file is stored) with command ...

python3.7m -m ensurepip

... but it fails with the same report

zsh: command not found: python3.7m
vklidu
  • 36,165
  • 1
  • 61
  • 135
  • Have you tried just python -m pip install ... (from within the bin folder) – WhatAMesh Feb 13 '21 at 21:11
  • sure, but it goes to Mac's Python with report "...Python: No module named pip" – vklidu Feb 13 '21 at 21:33
  • Related https://blender.stackexchange.com/questions/5287/using-3rd-party-python-modules @vklidu do you have an installed system python matching blender pythons version? If so (IMO) it is sometimes simplest to pip install foo --user to have 3rd party module available for both system and blender python of same version. – batFINGER Feb 14 '21 at 16:13
  • @batFINGER No, system python is 2.7 on Catalina for some reason, so I don't want to break something (also it was recommended https://www.reddit.com/r/learnpython/comments/fux0iv/python2716_version_showing_in_macos_catalina/fmfe3v1/?utm_source=reddit&utm_medium=web2x&context=3 to keep it untouched and rather install python3 within into virtual envi) and also don't install modules globally. So it sounds as more problems for me ... – vklidu Feb 14 '21 at 16:42
  • @vklidu No?? , by system, meant on the system (as opposed to blender python install) eg via a pyenv, (not changing your system's default python) . https://stackoverflow.com/questions/42988977/what-is-the-purpose-of-pip-install-user As noted in 3rd party link can remove (rename) blenders python folder and use a matching version on your system. – batFINGER Feb 14 '21 at 17:01
  • Sorry, I became lost what is your suggestion ... – vklidu Feb 14 '21 at 17:49
  • Firstly would be to use ./python3.7 to avoid the command not found error, when attempting to run a binary that is in current folder but not in $PATH – batFINGER Feb 15 '21 at 15:26
  • @batFINGER I just get it to work with easy but totally weird solution (answer), but since I very often use experimental version, extending specific blender's python inside a build is not a solution. So when I will have a time I try --user thing :) Thank you for patience. – vklidu Feb 16 '21 at 22:39

1 Answers1

1

Update 2024-02-02

There is an addon for installation and module management https://github.com/amb/blender_pip


Original post ...

For some reason using cd to blender's python bin folder and then executed command was not working, but ... path to blender's bin folder with python3.7m + command executed at once worked just fine.


Do I have a "pip"?

I don't know if 2.80 was distributed without a pip (as mentioned above), but 2.79 and also 2.83 Mac build containes a pip ... executing ensurepip was satisfied. You can check that by right click on Blender.app icon > Show Package Contents > Contents > Resources > 2.9x > python > bin, drag&drop bin folder into Terminal window, type python3.7m -m ensurepip and execute. In my case it looked like ...

/Users/Filip/Downloads/Blender\ 92.app/Contents/Resources/2.92/python/bin/python3.7m -m ensurepip

Upgrade "pip"

Terminal recommend update pip to latest version. So copy&paste directory of bin folder or drag&drop bin folder again into Terminal window, type python3.7m -m pip install --upgrade pip and execute. My example ...

/Users/Filip/Downloads/Blender\ 92.app/Contents/Resources/2.92/python/bin/python3.7m -m pip install --upgrade pip

Module installation

From what I tried, even without pip care I could just install module by command
python3.7m -m pip install + type your module name. In my case open3d module...

/Users/filip/Downloads/Blender\ 92.app/Contents/Resources/2.92/python/bin/python3.7m -m pip install open3d
vklidu
  • 36,165
  • 1
  • 61
  • 135