FreeCAD / FreeCAD-render

The Render workbench
Other
153 stars 31 forks source link

Render 2024.7.4 error code after FC program start #435

Open MakerFC opened 1 month ago

MakerFC commented 1 month ago
11:38:02  [Render][Init] Checking dependencies...
11:38:02  [Render][Init] >>> Environment folder does not exist - Creating

11:38:03  [Render][Init] Virtual environment error
11:38:03  Traceback (most recent call last):
11:38:03    File "/home/user/.local/share/FreeCAD/Mod/Render/./Render/rdrexecutor.py", line 160, in run
    res = self.func(*self.args)
          ^^^^^^^^^^^^^^^^^^^^^
11:38:03    File "/home/user/.local/share/FreeCAD/Mod/Render/./Render/virtualenv.py", line 89, in rendervenv_worker
    _create_virtualenv()
11:38:03    File "/home/user/.local/share/FreeCAD/Mod/Render/./Render/virtualenv.py", line 354, in _create_virtualenv
    subprocess.run(
11:38:03    File "/tmp/.mount_FreeCApVhZwd/usr/lib/python3.11/subprocess.py", line 571, in run
    raise CalledProcessError(retcode, process.args,
11:38:03  subprocess.CalledProcessError: Command '['/usr/bin/python3', '-I', '-u', '/tmp/tmpclvmjwen/virtualenv.pyz', '/home/user/.local/share/FreeCAD/.rendervenv']' returned non-zero exit status 1.
11:38:03

OS: openSUSE Leap 15.5 (KDE//usr/share/xsessions/default) Word size of FreeCAD: 64-bit Version: 0.22.0dev.38385 (Git) AppImage Build type: Release Branch: main Hash: 58241e027e7187a1ecaeeb75668ef9a497437c68 Python 3.11.9, Qt 5.15.13, Coin 4.0.2, Vtk 9.2.6, OCC 7.7.2 Locale: Installed mods:

howetuft commented 1 month ago

Hello,

Could you please do the following:

  1. Download virtualenv bootstrap here: https://bootstrap.pypa.io/virtualenv.pyz

  2. Run the following in a terminal:

/usr/bin/python3 -I -u /path/to/virtualenv.pyz /home/user/.local/share/FreeCAD/.rendervenv

and send me the result?

MakerFC commented 1 month ago

Hi howetuft,

as desired here comes the (un)desired result: :-)

Traceback (most recent call last):
  File "/usr/lib64/python3.6/runpy.py", line 185, in _run_module_as_main
    mod_name, mod_spec, code = _get_main_module_details(_Error)
  File "/usr/lib64/python3.6/runpy.py", line 219, in _get_main_module_details
    return _get_module_details(main_name)
  File "/usr/lib64/python3.6/runpy.py", line 128, in _get_module_details
    spec = importlib.util.find_spec(mod_name)
  File "/usr/lib64/python3.6/importlib/util.py", line 91, in find_spec
    return _find_spec(fullname, None)
  File "<frozen importlib._bootstrap>", line 894, in _find_spec
  File "<frozen importlib._bootstrap_external>", line 1157, in find_spec
  File "<frozen importlib._bootstrap_external>", line 1131, in _get_spec
  File "<frozen importlib._bootstrap_external>", line 1112, in _legacy_get_spec
  File "<frozen importlib._bootstrap>", line 441, in spec_from_loader
  File "<frozen importlib._bootstrap_external>", line 544, in spec_from_file_location
  File "/home/mick/FreeCAD/FC_Render/virtualenv.pyz/__main__.py", line 1
SyntaxError: future feature annotations is not defined
howetuft commented 1 month ago

Hello, You closed the issue as completed, is it intentional? Concerning the exception, there's a mess between 2 versions of Python (3.11 and 3.6). Would you know the reason why there would be those 2 versions on your system?

howetuft commented 1 month ago

It may also be related to #431

MakerFC commented 1 month ago

Hi howetuft,

Oh, I didn't want to close the point. The problem still exists. As far as I know, the mix of different python versions on openSUSE systems is usual. The openSUSE world is characterised by a strange mix of old and current software. Completely incomprehensible is the ancient Python version 3.6 (current would be 3.11).

My openSUSE Leap 15.5 System shows completely different versions:

  $ ls -al /usr/bin/pytho*
lrwxrwxrwx 1 root root     9 19. Mai 20:27 /usr/bin/python -> python2.7
lrwxrwxrwx 1 root root     9 19. Mai 20:27 /usr/bin/python2 -> python2.7
-rwxr-xr-x 1 root root  6280 19. Mai 20:27 /usr/bin/python2.7
lrwxrwxrwx 1 root root     9 28. Jun 12:01 /usr/bin/python3 -> python3.6
-rwxr-xr-x 1 root root  6392 28. Jun 11:53 /usr/bin/python3.10
-rwxr-xr-x 1 root root  6392 28. Jun 11:58 /usr/bin/python3.11
-rwxr-xr-x 2 root root 10560 28. Jun 12:01 /usr/bin/python3.6
lrwxrwxrwx 1 root root    17 28. Jun 12:01 /usr/bin/python3.6-config -> python3.6m-config
-rwxr-xr-x 2 root root 10560 28. Jun 12:01 /usr/bin/python3.6m
-rwxr-xr-x 1 root root  3440 28. Jun 12:01 /usr/bin/python3.6m-config
lrwxrwxrwx 1 root root    16 28. Jun 12:01 /usr/bin/python3-config -> python3.6-config
lrwxrwxrwx 1 root root    45  9. Apr 11:22 /usr/bin/pythontex -> ../share/texmf/scripts/pythontex/pythontex.py
howetuft commented 1 month ago

Hello, My understanding of the problem: Your system Python version is 3.6, although there are alternatives installed (3.10, 3.11). This is the Python version which Render finds when trying to fetch its dependencies. However, Render requires 3.8 or higher, so it results in an exception. Now I must think of a solution (maybe allow the user to set the python interpreter in the worbench settings)... However, in the meantime, if you have a way to set 3.11 as the system version, that may also work.

howetuft commented 1 month ago

@MakerFC I reopen. Have you been notified of my last posts, as the issue was closed?

MakerFC commented 1 month ago

Yes of course, I read all posts.

howetuft commented 3 weeks ago

Hello @MakerFC,

Sorry, I took a few days off - thought about your issue, however.

To me, what you need is a version manager for Python. I've found that openSUSE has pyenv (https://software.opensuse.org/package/pyenv?locale=en): could you please give it a try?

The way I would suggest to do:

Can you let me know?

MakerFC commented 3 weeks ago

Hello howetuft, Thank you very much for your continued involvement. Pyenv was already installed on my OS. The result output of the command is not really enlightening: ` $ pyenv versions

howetuft commented 3 weeks ago

OK. In that case, I may suggest you install a suitable alternative version via pyenv, for instance: $ pyenv 3.11 And then run the steps 2 to 5

howetuft commented 1 week ago

Hello @MakerFC,

Have you been able to try the above proposition? Thank you!