Converting to Python object not allowed without gil
Nobody has claimed this yet.
- Dominant language
- Jupyter Notebook
- Stars
- 4.8k
- Forks
- 827
- PR merge metrics
- No merged PRs in 30d
Description
Please HELP....thanks a lot!
I would like to install EconML by locally compiling mode
envs:
OS: windows10
python:3.11
steps:
- git clone from github by : git clone git@github.com:py-why/EconML.git
- cd EconML
- install: pip install --no-build-isolation --editable .
but, a error occurred like:
Error compiling Cython file:
------------------------------------------------------------
dlacpy(UPLO, &lda, &n, a, &lda, a_copy, &lda)
if copy_b:
dlacpy(UPLO, &ldb, &nrhs, b, &ldb, b_copy, &ldb)
dgelsy(&m, &n, &nrhs, a_copy, &lda, b_copy, &ldb,
&jpvt[0], &rcond, &rank, &work[0], &lwork, &info)
^
------------------------------------------------------------
**econml\grf\_utils.pyx:141:58: Converting to Python object not allowed without gil**
Warning: Multiple cython sources found for extension '*': ['econml\\grf\\_criterion.pyx', 'econml\\grf\\_utils.pyx', 'econml\\policy\\_forest\\_criterion.pyx', 'econml\\tree\\_criterion.pyx', 'econml\\tree\\_splitter.pyx', 'econml\\tree\\_tree.pyx', 'econml\\tree\\_utils.pyx']
See https://cython.readthedocs.io/en/latest/src/userguide/sharing_declarations.html for sharing declarations among Cython files.
Compiling econml\grf\_criterion.pyx because it changed.
Compiling econml\grf\_utils.pyx because it changed.
Compiling econml\policy\_forest\_criterion.pyx because it changed.
Compiling econml\tree\_criterion.pyx because it changed.
Compiling econml\tree\_splitter.pyx because it changed.
Compiling econml\tree\_tree.pyx because it changed.
Compiling econml\tree\_utils.pyx because it changed.
[1/7] Cythonizing econml\grf\_criterion.pyx
[2/7] Cythonizing econml\grf\_utils.pyx
Traceback (most recent call last):
File "C:\Users\Admin\miniconda3\envs\econml\Lib\site-packages\pip\_vendor\pyproject_hooks\_in_process\_in_process.py", line 353, in <module>
main()
File "C:\Users\Admin\miniconda3\envs\econml\Lib\site-packages\pip\_vendor\pyproject_hooks\_in_process\_in_process.py", line 335, in main
json_out['return_val'] = hook(**hook_input['kwargs'])
^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\Admin\miniconda3\envs\econml\Lib\site-packages\pip\_vendor\pyproject_hooks\_in_process\_in_process.py", line 181, in prepare_metadata_for_build_editable
return hook(metadata_directory, config_settings)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\Admin\miniconda3\envs\econml\Lib\site-packages\setuptools\build_meta.py", line 473, in prepare_metadata_for_build_editable
return self.prepare_metadata_for_build_wheel(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\Admin\miniconda3\envs\econml\Lib\site-packages\setuptools\build_meta.py", line 396, in prepare_metadata_for_build_wheel
self.run_setup()
File "C:\Users\Admin\miniconda3\envs\econml\Lib\site-packages\setuptools\build_meta.py", line 341, in run_setup
exec(code, locals())
File "<string>", line 28, in <module>
File "C:\Users\Admin\miniconda3\envs\econml\Lib\site-packages\Cython\Build\Dependencies.py", line 1154, in cythonize
cythonize_one(*args)
File "C:\Users\Admin\miniconda3\envs\econml\Lib\site-packages\Cython\Build\Dependencies.py", line 1321, in cythonize_one
raise CompileError(None, pyx_file)
Cython.Compiler.Errors.CompileError: econml\grf\_utils.pyx
could anyone help me for this issue? thanks a lot
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Reproduce the editable install on Windows 10 with Python 3.11 using the command in the report, then inspect econml/grf/_utils.pyx at line 141 and the Cython compilation output. Confirm the cause of the GIL error and that the editable installation completes successfully without the reported CompileError.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- build-system, machine-learning
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100