1

What I've Tried:

A github repo imports bpy, so I tried

  1. to build Blender via git clone but the install_deps.sh command fail because it cannot install a requested package, libpystring-dev.

  2. pip install bpy - nope.

  3. This guy's writeup started to get somewhere, but still no recognized bpy module after an ostensibly successful run-through.

Since I need to install Blender in my WSL Ubuntu, I'm not sure else how to do this.

Corresponding Errors:

1. Build Blender via git clone:

 ./blender/build_files/build_environment/install_deps.sh
WARNING! ****WARNING****
If you are experiencing issues building Blender, _*TRY A FRESH, CLEAN BUILD FIRST*_!
The same goes for install_deps itself, if you encounter issues, please first erase everything in /home/domattioli/src/blender-deps and /opt/lib
(provided obviously you did not add anything yourself in those dirs!), and run install_deps.sh again!
Often, changes in the libs built by this script, or in your distro package, cannot be handled simply, so...

You may also try to use the '--build-foo' options to bypass your distribution's packages
for some troublesome/buggy libraries...


Ran with:
    install_deps.sh



Installing dependencies for DEB-based distribution

Source code of dependencies needed to be compiled will be downloaded and extracted into '/home/domattioli/src/blender-deps'.
Built libs of dependencies needed to be compiled will be installed into '/opt/lib'.
Please edit $SRC and/or $INST variables at the beginning of this script,
or use --source/--install options, if you want to use other paths!

Number of threads for building: 24 (automatically detected, use --threads=<nbr> to override it).
Full install: false (use --with-all option to enable it).
Building OpenCOLLADA: false (use --with-opencollada option to enable it).
Building Embree: false (use --with-embree option to enable it).
Building OpenImageDenoise: false (use --with-oidn option to enable it).

Example:
Full install without OpenCOLLADA: --with-all --skip-opencollada

Use --help to show all available options!

Do you want to continue (Y/n)?y
Get:1 file:/var/cuda-repo-wsl-ubuntu-11-7-local  InRelease [1575 B]
Get:1 file:/var/cuda-repo-wsl-ubuntu-11-7-local  InRelease [1575 B]
Get:2 file:/var/cudnn-local-repo-ubuntu2004-8.4.1.50  InRelease [1575 B]
Get:2 file:/var/cudnn-local-repo-ubuntu2004-8.4.1.50  InRelease [1575 B]
Get:3 https://nvidia.github.io/libnvidia-container/stable/ubuntu18.04/amd64  InRelease [1484 B]
Get:4 https://nvidia.github.io/nvidia-container-runtime/stable/ubuntu18.04/amd64  InRelease [1481 B]
Get:5 https://nvidia.github.io/nvidia-docker/ubuntu18.04/amd64  InRelease [1474 B]
Hit:6 https://packages.microsoft.com/ubuntu/20.04/prod focal InRelease
Hit:7 http://developer.download.nvidia.com/compute/cuda/repos/ubuntu1804/x86_64  InRelease
Hit:8 https://arkane-systems.github.io/wsl-transdebian/apt focal InRelease
Get:9 http://security.ubuntu.com/ubuntu focal-security InRelease [114 kB]
Hit:10 https://developer.download.nvidia.com/compute/cuda/repos/wsl-ubuntu/x86_64  InRelease
Hit:11 http://ppa.launchpad.net/graphics-drivers/ppa/ubuntu focal InRelease
Hit:12 http://archive.ubuntu.com/ubuntu focal InRelease
Hit:13 http://archive.canonical.com/ubuntu focal InRelease
Get:14 http://archive.ubuntu.com/ubuntu focal-updates InRelease [114 kB]
Hit:15 http://ppa.launchpad.net/saiarcot895/chromium-dev/ubuntu focal InRelease
Hit:16 http://ppa.launchpad.net/thomas-schiex/blender/ubuntu focal InRelease
Get:17 http://archive.ubuntu.com/ubuntu focal-backports InRelease [108 kB]
Fetched 340 kB in 1s (399 kB/s)
Reading package lists... Done




Reading package lists... Done
Building dependency tree
Reading state information... Done
Note, selecting 'libfontconfig1-dev' instead of 'libfontconfig-dev'
E: Unable to locate package libpystring-dev
ERROR! apt-get failed to install requested packages, exiting.

2. pip install bpy:

pip install bpy
Collecting bpy
  Using cached bpy-0.0.0a0.tar.gz (19 kB)
    ERROR: Command errored out with exit status 1:
     command: /home/domattioli/miniconda3/bin/python -c 'import io, os, sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-qiee2cmh/bpy_a414fb89254042aa8aa952fca27c77e4/setup.py'"'"'; __file__='"'"'/tmp/pip-install-qiee2cmh/bpy_a414fb89254042aa8aa952fca27c77e4/setup.py'"'"';f = getattr(tokenize, '"'"'open'"'"', open)(__file__) if os.path.exists(__file__) else io.StringIO('"'"'from setuptools import setup; setup()'"'"');code = f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' egg_info --egg-base /tmp/pip-pip-egg-info-ojmq4blc
         cwd: /tmp/pip-install-qiee2cmh/bpy_a414fb89254042aa8aa952fca27c77e4/
    Complete output (16 lines):
    Traceback (most recent call last):
      File "/home/domattioli/miniconda3/lib/python3.9/tokenize.py", line 342, in find_cookie
        codec = lookup(encoding)
    LookupError: unknown encoding: future_fstrings

    During handling of the above exception, another exception occurred:

    Traceback (most recent call last):
      File "<string>", line 1, in <module>
      File "/home/domattioli/miniconda3/lib/python3.9/tokenize.py", line 394, in open
        encoding, lines = detect_encoding(buffer.readline)
      File "/home/domattioli/miniconda3/lib/python3.9/tokenize.py", line 381, in detect_encoding
        encoding = find_cookie(second)
      File "/home/domattioli/miniconda3/lib/python3.9/tokenize.py", line 350, in find_cookie
        raise SyntaxError(msg)
    SyntaxError: unknown encoding for '/tmp/pip-install-qiee2cmh/bpy_a414fb89254042aa8aa952fca27c77e4/setup.py': future_fstrings
    ----------------------------------------
WARNING: Discarding https://files.pythonhosted.org/packages/bc/e2/20c6d56f1143e13c0fc24a7d987ee28e4949b8edbbbb1b66f705d129bdc5/bpy-0.0.0a0.tar.gz#sha256=b48c0348cccaf9ad316bccd3dc65fdc8422e4c310c79c85448b01ae7feb7f02e (from https://pypi.org/simple/bpy/) (requires-python:>=3.4.0). Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output.
ERROR: Could not find a version that satisfies the requirement bpy (from versions: 0.0.0a0)
ERROR: No matching distribution found for bpy
  1. Github writeup:
domattioli@DSI-8VD8XP3:/usr/include/blender-git/lib/linux_centos7_x86_64/python/bin$ ls
python3.10  python3.7m  python3.9
(base) domattioli@DSI-8VD8XP3:/usr/include/blender-git/lib/linux_centos7_x86_64/python/bin$ python3.9
Python 3.9.12 (main, Apr  5 2022, 06:56:58)
[GCC 7.5.0] :: Anaconda, Inc. on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import bpy
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
ModuleNotFoundError: No module named 'bpy'
>>>
domattioli
  • 11
  • 2
  • Looks like libpystring-dev is in Jammy (22.04), https://ubuntu.pkgs.org/22.04/ubuntu-universe-arm64/libpystring-dev_1.1.3-2_arm64.deb.html. You can try installing the deb from Jammy without updating your release, YMMV. At your own risk! – pbhj Aug 30 '22 at 23:06
  • 1
    Is there are way to force the installation? The deb doesn't show up with ```apt-file search```, I suspect, because it is not available for 20.04 – domattioli Aug 31 '22 at 20:06
  • You can download it from https://packages.ubuntu.com or the other site I mentioned, install from the command line with `sudo apt install ./path/to/$package` (or `dpkg -i`). – pbhj Sep 01 '22 at 17:02

0 Answers0