Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

multiprocess doesn't honor modified sys.path and fails with ModuleNotFoundError: No module named 'multiprocess' #107

Open
jiasli opened this issue Mar 1, 2022 · 1 comment
Labels

Comments

@jiasli
Copy link

jiasli commented Mar 1, 2022

We use pip install --target to install pathos, multiprocess and other dependencies into a custom location and import multiprocess after modifying sys.path:

import sys

sys.path.append(r'C:\Users\name\.azure\cliextensions\confcom')

import multiprocess
m = multiprocess.Manager()

(The actual code is https://github.com/Azure/azure-cli/blob/2e87ac82207b345be80aa7051cabf5071f1b94dd/src/azure-cli-core/azure/cli/core/extension/operations.py#L498)

This causes failure:

Traceback (most recent call last):
  File "<string>", line 1, in <module>
ModuleNotFoundError: No module named 'multiprocess'

This issue only happens on Windows, not Linux.

Is this a supported use case? If not, what is the best way to let multiprocess honor modified sys.path. Thanks a lot for the help.

@mmckerns
Copy link
Member

Sorry this was ignored for so long. I'm not sure what you are asking. It seems that you are using an install to a custom location... and if that location is not on the python path, I'd expect that the module would not be found. The standard way to address that is either to alter the python path environment variable (outside of python) or to modify the sys.path variable while using python. If that's not what you are asking, and it's still relevant for you, please clarify.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants