Can you provide a test case that demonstrates this? I can take a look,
then. In theory this is happening fairly early in the execution of your
program so it should be reasonably easy to replicate.

Just out of curiosity, what happens if you use an absolute path when
running your application?

Anthony

On Fri, Nov 18, 2016 at 5:43 AM, Richie Ward <rich...@gmail.com> wrote:

> I need to tell cx_freeze the full path of ./lib/python35.zip as my app
> requires changing the current directory. I am using os.chdir to change
> directory.
>
> Due to the design of my program, I cannot change it back in time to
> prevent the traceback as it runs foreign code. I tried adding the lib
> folder to sys.path but cx_freeze still doesn't find its required
> python35.zip file.
>
> I get the following traceback on my program:
> r@r-H61N-USB3:~/Code/hypernucleus/hn$ ./run_hypernucleus -r kitten_command
> /home/r/Code/hypernucleus/hn/lib/python35.zip
> Traceback (most recent call last):
>  File "<frozen importlib._bootstrap>", line 969, in _find_and_load
>  File "<frozen importlib._bootstrap>", line 958, in _find_and_load_unlocked
>  File "<frozen importlib._bootstrap>", line 664, in _load_unlocked
>  File "<frozen importlib._bootstrap>", line 634, in
> _load_backward_compatible
>  File "/usr/local/lib/python3.5/dist-packages/cx_Freeze-5.0-
> py3.5-linux-x86_64.egg/cx_Freeze/initscripts/__startup__.py",
> line 12, in <module>
>    __import__(name + "__init__")
>  File "<frozen importlib._bootstrap>", line 969, in _find_and_load
>  File "<frozen importlib._bootstrap>", line 958, in _find_and_load_unlocked
>  File "<frozen importlib._bootstrap>", line 664, in _load_unlocked
>  File "<frozen importlib._bootstrap>", line 634, in
> _load_backward_compatible
>  File "/usr/local/lib/python3.5/dist-packages/cx_Freeze-5.0-
> py3.5-linux-x86_64.egg/cx_Freeze/initscripts/Console.py",
> line 21, in <module>
>    scriptModule = __import__(moduleName)
>  File "<frozen importlib._bootstrap>", line 969, in _find_and_load
>  File "<frozen importlib._bootstrap>", line 958, in _find_and_load_unlocked
>  File "<frozen importlib._bootstrap>", line 664, in _load_unlocked
>  File "<frozen importlib._bootstrap>", line 634, in
> _load_backward_compatible
>  File "run_hypernucleus.py", line 3, in <module>
>  File "/home/r/Code/hypernucleus/hypernucleus/__init__.py", line 45, in
> main
>    game_mgr.execute_game(args.run_game)
>  File "/home/r/Code/hypernucleus/hypernucleus/library/game_manager.py",
> line 62, in execute_game
>    game = __import__(game_name)
>  File "/home/r/.config/hypernucleus/games/kitten_command/kitten_
> command.py",
> line 19, in <module>
>    from __future__ import division
>  File "<frozen importlib._bootstrap>", line 969, in _find_and_load
>  File "<frozen importlib._bootstrap>", line 954, in _find_and_load_unlocked
>  File "<frozen importlib._bootstrap>", line 896, in _find_spec
>  File "<frozen importlib._bootstrap_external>", line 1147, in find_spec
>  File "<frozen importlib._bootstrap_external>", line 1123, in _get_spec
>  File "<frozen importlib._bootstrap_external>", line 1104, in
> _legacy_get_spec
>  File "<frozen importlib._bootstrap>", line 444, in spec_from_loader
>  File "<frozen importlib._bootstrap_external>", line 541, in
> spec_from_file_location
> FileNotFoundError: [Errno 2] No such file or directory:
> './lib/python35.zip'
>
> Any idea on how to fix this? I need to force it to use a absolute path
> or make it look in sys.path for it (or something similar). I am using
> cx_freeze 5.0 and Ubuntu Linux.
>
> --
> Thanks, Richie Ward
> https://uk.linkedin.com/in/richie-ward-07ab0495
>
> ------------------------------------------------------------
> ------------------
> _______________________________________________
> cx-freeze-users mailing list
> cx-freeze-users@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/cx-freeze-users
>
------------------------------------------------------------------------------
_______________________________________________
cx-freeze-users mailing list
cx-freeze-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/cx-freeze-users

Reply via email to