marcelotduarte/cx_Freeze

Cannot add venv due to relative absolute path

aminvandh opened this issue · 3 comments

When i add venv to include_files, it just throws this error:
ValueError: '/home/User/temp2/t/X/build/exe/venv/lib/python3.10/site-packages/pillow.libs/libopenjp2-eca49203.so.2.5.0' is not in the subpath of '/home/User/temp2/t/X/build/exe/lib' OR one path is relative and the other is absolute.

Full Setup.py code:

from cx_Freeze import setup, Executable

build_options = {'packages': [r'regex', r'trio', r'PIL'], 'excludes': [r'build'],
                 r'include_files': [r'static', r'./venv'], r'build_exe': 'build/exe' }

base = 'console'

executables = [
   Executable('server.py', base=base)
]

setup(name='API-Server',
      version = '1.0',
      description = '',
      options = {'build_exe': build_options},  # Wrap build_options in a dictionary
      executables = executables)

Desktop (please complete the following information):

  • Platform information (e.g. Ubuntu Linux 22.04): WSL2, Ubuntu 22.04
  • OS architecture (e.g. amd64): AMD64
  • cx_Freeze version [e.g. 6.11]: 6.15.15
  • Python version [e.g. 3.10]: 3.10

It doesn't make much sense for you to include the venv directory (all files at venv). For example, this file that reported an error will be copied to the correct location when importing the PIL (pillow). In fact, including PIL in packages is unnecessary, because when it is imported into the code, the dependencies will be copied.

It doesn't make much sense for you to include all of venv. For example, this file that reported an error will be copied to the correct location when importing the PIL (pillow). In fact, including PIL in packages is unnecessary, because when it is imported into the code, the dependencies will be copied.

Thank you, Yes i am aware of that, i did add for test (adding PIL in packages), the main issuse is i cannot add venv directory.

Thank you, You are right i do not have to add ./venv since they are all included.