-
-
Notifications
You must be signed in to change notification settings - Fork 504
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
ImportError: DLL load failed while importing _psycopg: The specified module could not be found in python 3.9 #1160
Comments
I am having the same issue with python 3.9. |
Python 3.9 is not supported yet. Packages have not been released. |
What is blocking the release? This is only happening on Windows for me. Related #1099 |
Appveyor doesn't support Python 3.9 yet: https://ci.appveyor.com/project/psycopg/psycopg2-wheels/builds/35677049 |
Close psycopg/psycopg2#1162 See also psycopg/psycopg2#1160. For the moment Windows package won't be built because of issing support on Appveyor.
For reference, the Appveyor issue tracking Python 3.9 support, which seems to prevent the Python 3.9 Windows psycopg2-binary build. There seems to be a way to manually install Python 3.9 for Appveyor CI, described in appveyor/ci#3467 (comment). @dvarrazzo Could this be an option to get it built sooner? |
@ahtik I don't have resources to work on this issue in this moment. If someone provides a patch I can release packages before Appveyor completes Python 3.9 support. |
@dvarrazzo Python 3.9.0 is now listed at appveyor/ci#3541 and as of today 3.9.0 is listed at https://www.appveyor.com/docs/windows-images-software/#python. Could you try running the https://ci.appveyor.com/project/psycopg/psycopg2-wheels build again to heal the PY_VER=39 section? |
@ahtik Sure, trying a build. |
@ahtik Still can't find the executable on the appveyor machine: |
@ahtik Looks like Python 3.9 is not quite there yet. This is what is available on the Appveyor machine: https://ci.appveyor.com/project/psycopg/psycopg2/build/job/igre2hjljb3ythao I can try to re-run the job later or in a few days. |
@dvarrazzo Interesting, I just created a basic empty project where 3.9 seems to be available, https://ci.appveyor.com/project/ahtik/appv-39-exp/build/job/mdbt9env6vawk80q https://github.com/psycopg/psycopg2/blob/master/.appveyor.yml doesn't have an image name specified, so maybe the default is not yet switched and adding smth like image: |
@ahtik I don't understand: your appveyor doesn't have an |
@dvarrazzo My appveyor setup and the whole project was new, I speculated that the "old" projects without pinned env in .yml might be still using older images for slower rollout. To be sure I added image also to the conf and seems to work as well. The Build worker image in Settings is still "Visual Studio 2019", not the "Previous...", right? |
Seriously? A menu? The yaml file was too much a repeatable experience? The image of the project was on VS 2015. I switched it to VS 2019, however it doesn't seem to have changed much (https://ci.appveyor.com/project/psycopg/psycopg2/builds/35986746/job/vpalli48lhh3c7e5). |
@dvarrazzo Apparently this menu item gets ignored when you have yaml file already in place, even without an image name. So the default image definition comes from wherever :) See appveyor/ci#3541 (comment) |
@ahtik thank you: setting the image into appveyor worked indeed. The build fails for other reasons that for us forward-slashed people are rather obscure: https://ci.appveyor.com/project/psycopg/psycopg2/builds/35989526/job/t9531ml0y4g6jrwl Would you be able to fix the build? Thank you very much |
The VC 2019 image has a different version of perl causing that error https://www.appveyor.com/docs/windows-images-software/. A quick hack to add the Strawberry Perl path (C:\Strawberry\perl\bin) before the git perl path continues the build process, but I'm not far enough along to know what other issues this may cause. The perl issue is not the only error in that log. VS 2019 default's location is different: C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Auxiliary\Build, so the compiler does not get setup. I'm on another issue that I've come across with building the openssl libs:
I've got to pause working on this for awhile, but I'll pick it up later this evening. |
@jerickso Thank you, that would be amazing! If you are looking into the Windows build, some time ago building the libpq started failing, so the version is being held back to 11.4. There are more details at 5e9572a. If you could restore build using libpq from Postgres 12 or 13 it would be amazing. Thank you very much! |
I'll have to spend some more time getting it to build against a newer Postgres. My initial attempt was sending me down a path that would take some time to hammer out. I'll get it on my list to revisit it. I'm still doing regression testing with the changes, but I did submit a pull requests for both psycopg2 and the wheels repository. I did not have any of the new appveyor config changes in the psycopg2 repository pull request. |
@jerickso thank you for your work
Do you mean these? https://github.com/psycopg/psycopg2/commits/py39-appveyor |
Sorry I wasn't clearer. I didn't modify the appveyor yaml file in the main psycopg2 repository, just the psycopg2-wheels repository. In hind sight I should have just used the psycopg2 repository since there was a appveyor yaml file there, and it was more work testing out code updates in two repositories. I had the wheels repository already setup in my appveyor account so started my testing there. I'll see it didn't build so I'll get the main repository yaml file updated and do another pull request. |
I'm with sabe problem, but im using Python 3.8 on Windows. |
I have same problem, Python 3.9, Postgresql 13 |
Windows packages for Python 3.9 are now available: https://pypi.org/project/psycopg2/#files |
Thank you very much to help with them, @jerickso :) |
@dvarrazzo
do you think those issues are related? |
@domdinicola no, it's not related: this is a windows ticket. |
Issue persists with python 3.9 and latest install of psycopg2 in c:\users\jehertzi\appdata\local\programs\python\python39\lib\site-packages (2.8.6) ~\AppData\Local\Programs\Python\Python39\lib\site-packages\psycopg2_init_.py in ImportError: DLL load failed while importing _psycopg: The specified module could not be found. |
Conda is still pointing to 2.8.6 while pip is pointing to 2.9.1. Until the Conda wheels get updated:
|
this still happens to python 3.10, I need to revert to 3.9.6 to make it work |
I am trying to work postgres with python 3.10 and the error has stopped me. |
Actually, we have the same problem. |
Closing as the issue is long fixed and is attracting unrelated search results. |
Import failed while working with Python 3.9 experience this issue, But it's fine in 3.7 and 3.8.
Using psycopg2 2.8.6
The text was updated successfully, but these errors were encountered: