Message323278
For my python development I have several directories on my Windows system:
common:
F:\python\scripts -> one-file-scripts based on python 2
F:\python\scripts3 -> one-file-scripts base on python 3
projects:
F:\python\projects\timetracking
...
Each directory has its own virtual environment (managed with pipenv):
F:\python\scripts\.venv
F:\python\scripts3\.venv
F:\python\projects\timetracking\.venv
Because I want to be able to call the scripts from everywhere, I added the directories to the path-environment variable.
[...]F:\Python\scripts3;F:\Python\projects\timetracking[...]
Let's have a look at the timetracking project. The main script (timetracking.py) has the following shebang-line:
#! /usr/bin/env .venv/scripts/python.exe
My current directory is the root of C
When I call 'timetracking.py' I get an error that some modules have not been installed.
With activating the debug mode (set PYLAUNCH_DEBUG=1) I get some more information:
***
C:\>timetracking.py
launcher build: 32bit
launcher executable: Console
File 'C:\Users\itsme\AppData\Local\py.ini' non-existent
File 'C:\Windows\py.ini' non-existent
Called with command line: "F:\Python\projects\timetracking\timetracking.py"
maybe_handle_shebang: read 256 bytes
maybe_handle_shebang: BOM not found, using UTF-8
parse_shebang: found command: F:\Python\scripts3\.venv\scripts\python.exe
run_child: about to run 'F:\Python\scripts3\.venv\scripts\python.exe "F:\Python\projects\timetracking\timetracking.py" '
Traceback (most recent call last):
File "F:\Python\projects\timetracking\timetracking.py", line 18, in <module>
import menu_definitions
File "F:\Python\projects\timetracking\menu_definitions.py", line 15, in <module>
import menu_edit_item_functions
File "F:\Python\projects\timetracking\menu_edit_item_functions.py", line 15, in <module>
import tools
File "F:\Python\projects\timetracking\tools.py", line 19, in <module>
from texttable import Texttable
ModuleNotFoundError: No module named 'texttable'
child process exit code: 1
***
As you can see, the pylauncher found a shebang - but not that one I expected ('scripts3\.venv' instead of 'timetracking\.venv') *confused*
It seems that the pylauncher uses the first .venv it found within the path variable...
Any ideas? |
|
Date |
User |
Action |
Args |
2018-08-08 14:30:16 | sfx2k | set | recipients:
+ sfx2k, paul.moore, tim.golden, zach.ware, steve.dower |
2018-08-08 14:30:16 | sfx2k | set | messageid: <1533738616.85.0.56676864532.issue34359@psf.upfronthosting.co.za> |
2018-08-08 14:30:16 | sfx2k | link | issue34359 messages |
2018-08-08 14:30:16 | sfx2k | create | |
|