3 Feb 2023 |
| @a_ya:matrix.org joined the room. | 18:57:10 |
| @a_ya:matrix.org left the room. | 18:58:00 |
4 Feb 2023 |
| @raj27:matrix.org joined the room. | 05:17:03 |
| @raj27:matrix.org left the room. | 05:39:20 |
6 Feb 2023 |
| @adriqt:tchncs.de joined the room. | 23:09:29 |
| @adriqt:tchncs.de changed their display name from adriqt to adrian rodriguez. | 23:12:15 |
| @adriqt:tchncs.de changed their display name from adrian rodriguez to adrian. | 23:13:55 |
| @adriqt:tchncs.de set a profile picture. | 23:25:05 |
7 Feb 2023 |
| @adriqt:tchncs.de changed their profile picture. | 03:41:46 |
11 Feb 2023 |
| @adriqt:tchncs.de changed their profile picture. | 17:20:27 |
18 Feb 2023 |
| @commie:wetfish.chat changed their display name from commie to bigMcommie. | 17:13:12 |
19 Feb 2023 |
| @commie:wetfish.chat changed their display name from bigMcommie to commie. | 05:21:41 |
20 Feb 2023 |
| enessgurkan joined the room. | 07:32:57 |
23 Feb 2023 |
| @adriqt:tchncs.de changed their display name from adrian to adrián. | 01:57:16 |
name_missing | Im having difficulty using PYTHONPATH.
Does anyone have tips on how to use custom package paths with it? | 14:44:23 |
torped | Are you using python inside a flatpak? | 16:29:47 |
name_missing | No, Windows and Linux.
I got it to work with a bash script.
But for some reason im getting module not found if i use subprocess. | 21:55:29 |
| @adriqt:tchncs.de left the room. | 22:28:22 |
24 Feb 2023 |
torped | How are you using the sub-process? | 14:14:02 |
name_missing | Lets see if i can get a minimum example running. | 18:43:39 |
name_missing | ef run_application(
application: Pathed,
arguments: List[Pathed],
environment: Dict[str, str] = None
) -> subprocess.CompletedProcess:
if not Path(application).exists():
raise FileNotFoundError(f'{application}')
process_arguments = [f'{application}', *arguments]
information('Starting child process.', [process_arguments, environment])
result = subprocess.run(
process_arguments,
env=environment,
stderr=sys.stderr,
stdout=subprocess.DEVNULL,
stdin=subprocess.DEVNULL
)
| 19:43:26 |
name_missing | * def run_application(
application: Pathed,
arguments: List[Pathed],
environment: Dict[str, str] = None
) -> subprocess.CompletedProcess:
if not Path(application).exists():
raise FileNotFoundError(f'{application}')
process_arguments = [f'{application}', *arguments]
information('Starting child process.', [process_arguments, environment])
result = subprocess.run(
process_arguments,
env=environment
)
| 19:43:45 |
name_missing | * def run_application(
application: Pathed,
arguments: List[Pathed],
environment: Dict[str, str] = None
) -> subprocess.CompletedProcess:
if not Path(application).exists():
raise FileNotFoundError(f'{application}')
process_arguments = [f'{application}', *arguments]
information('Starting child process.', [process_arguments, environment])
result = subprocess.run(
process_arguments,
env=environment
)return result
| 19:43:57 |
name_missing | * def run_application(
application: Pathed,
arguments: List[Pathed],
environment: Dict[str, str] = None
) -> subprocess.CompletedProcess:
if not Path(application).exists():
raise FileNotFoundError(f'{application}')
process_arguments = [f'{application}', *arguments]
information('Starting child process.', [process_arguments, environment])
result = subprocess.run(
process_arguments,
env=environment
)
return result
| 19:44:13 |
25 Feb 2023 |
name_missing | This one works, so time to search for differences.
import os
import subprocess
from pathlib import Path
PYTHON_PATH: str = 'PYTHONPATH'
def main():
current = Path.cwd()
library = current.joinpath('venv', 'python3.9', 'site-packages')
interpreter = current.joinpath('venv', 'bin', 'python')
project = current.joinpath('test')
package = 'some.package.path'
filtered = {
key: value
for key, value
in os.environ.items()
if key != PYTHON_PATH
}
environment = {
PYTHON_PATH: f'{project}',
**filtered
}
arguments = [
interpreter,
'-m',
package
]
subprocess.run(
arguments,
env=environment
)
if __name__ == '__main__':
main()
| 12:20:54 |
28 Feb 2023 |
name_missing | At last i know the cause now. The debugger from Pycharm is using the wrong environment in child processes. Which triggers a design flaw in Pythons fake name space system. Exactly the reason why i wanted to use VENV in the first place. 😆
| 16:37:59 |
torped | Glad you worked through it! | 16:44:17 |
3 Mar 2023 |
| @ovoki:matrix.org joined the room. | 14:29:44 |
| @ovoki:matrix.org left the room. | 14:29:58 |
9 Mar 2023 |
| Paul Wood joined the room. | 06:39:01 |