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

[BUG] pyximport is ignoring sys.path #5615

Open
matusvalo opened this issue Aug 13, 2023 · 1 comment
Open

[BUG] pyximport is ignoring sys.path #5615

matusvalo opened this issue Aug 13, 2023 · 1 comment
Labels

Comments

@matusvalo
Copy link
Contributor

matusvalo commented Aug 13, 2023

Describe your issue

Consider following file tree:

########## mydir/mytest.pyx ##########
print('Hello world!')

Running command:

PYTHONPATH=mydir python -c 'import pyximport; pyximport.install(); import mytest'

from parent directory of mydir will fail with following error:

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

Expected behaviour

Compilation success since the module is present in PYTHONPATH.

OS

any

Python version

any

Cython version

master

Additional context

This bug is regression. Cython 0.29.X works correctly.

@jeremysanders
Copy link

jeremysanders commented Jul 15, 2024

A workaround hack is to import from the old version _pyximport2 for all python versions, e.g.

import pyximport._pyximport2 as pyximport
pyximport.install()

This is a pretty bad bug, however.

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