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

Cython Compile Error ' Converting to Python object not allowed without gil' during installation #14

Closed
technOslerphile opened this issue Apr 8, 2020 · 3 comments

Comments

@technOslerphile
Copy link

Hi,

I am facing issues whilst trying to install this library. I have Anaconda3, Python 3.7 and Cython 0.29.13.

pyross\deterministic.pyx:431:37: Converting to Python object not allowed without gil

Error compiling Cython file:
------------------------------------------------------------
...
            aa = bb*S[i]
            X[i]     = -aa
            X[i+M]   = aa - gI*I[i]

            for j in range(kk-1):
                X[i+(j+2)*M]   = gI*I[i+j*M] - gIa*I[i+(j+1)*M]
                                                 ^
------------------------------------------------------------

pyross\deterministic.pyx:431:50: Converting to Python object not allowed without gil
Traceback (most recent call last):
  File "setup.py", line 59, in <module>
    compiler_directives={"language_level": sys.version_info[0]},
  File "C:\Anaconda3\lib\site-packages\Cython\Build\Dependencies.py", line 1096, in cythonize
    cythonize_one(*args)
  File "C:\Anaconda3\lib\site-packages\Cython\Build\Dependencies.py", line 1219, in cythonize_one
    raise CompileError(None, pyx_file)
Cython.Compiler.Errors.CompileError: pyross\deterministic.pyx
@rajeshrinet
Copy link
Owner

rajeshrinet commented Apr 8, 2020

@technOslerphile please can you pull the latest version and try again? Thanks.

Edit: It should work now.

@technOslerphile
Copy link
Author

@rajeshrinet Thanks! It worked and the error mentioned in the original post is now solved.

However, I got two errors later which are:

1. vcvarsall.bat not found
2. cl.exe not found

I was able to fix these by installing Microsoft Visual Studio as mentioned here:
https://stackoverflow.com/questions/2817869/error-unable-to-find-vcvarsall-bat/60396650#60396650
Hope this will be useful to those who are having some issues in Windows.

By the way, your paper is phenomenal. I have never really found much COVID-19 mathematical model papers with this much clarity. Thank you very much!

@rajeshrinet
Copy link
Owner

@technOslerphile thanks very much for your kind words.

The solution for windows is very useful. I will share it with others. Thank you!

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

No branches or pull requests

2 participants