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

Fails to copy python3.dll to Virtualenv under Windows #1050

Closed
jdmansour opened this issue May 31, 2017 · 5 comments
Closed

Fails to copy python3.dll to Virtualenv under Windows #1050

jdmansour opened this issue May 31, 2017 · 5 comments

Comments

@jdmansour
Copy link

When creating a Virtualenv under Windows (using Python 3.6), it seems to work fine at first, but some modules (notably PyQt5) complain with ImportError: DLL load failed: The specified module could not be found.. The cause is that it fails to find python3.dll (not python3.6.dll). Manually copying it to the Scripts directory fixes the problem.

Another option would be to add the original Python directory to the PATH, but I think that might cause problems. Better to keep the Virtualenv separate from the main installation, at the expense of copying one more file.

I wonder how this is handled under Linux, I never had that problem there?

Here somebody mentions the problem in a different isue: #796 (comment)
I think this issue is related, but for Linux: #1015

@gst
Copy link

gst commented Jun 1, 2017

effectively this really looks like 1015 but on Windows.

I wonder how this is handled under Linux, I never had that problem there?

simply Linux system pythons (python coming with the Linux distributions) aren't compiled with that option (relative path to the shared library).
you have to compile one by hand and provide the option.

@gst
Copy link

gst commented Jun 1, 2017

@jdmansour fyi: python3 has its embedded venv module.. which is normally recommended over virtualenv

@jdmansour
Copy link
Author

@gst Interesting, I always thought that the builtin venv was identical to virtualenv. I just tried it out, and python -m venv myvenv does copy python3.dll. So I guess it would be good if virtualenv did the same for consistency (if you are still maintaining it, given there is venv in Python 3)?

One added complication is that I used virtualenvwrapper (or virtualenvwrapper-win) which seems to insist on using virtualenv the package.

@gst
Copy link

gst commented Jun 2, 2017

I m a user like you here ;) venv vs virtualenv: they are not the same yes.
If you are using python3 just use venv and all should be good I guess (had not the chance to use it/python3 recently).

@brupelo
Copy link

brupelo commented Sep 20, 2017

@dstufft Hi Donald, sorry to ping you but I've seen in the commit history you're a major contributor of virtualenv. Any possible solution about trivial issue?

Running virtualenv 15.1.0 on a windows platform will show this issue after installing pyqt5. Copying
manually the missing python3.dll to the Script folder will solve it.

So, wouldn't something like copying python3*.dll on the virtualenv Scripts folder if platform==windows solve it?

pfmoore added a commit that referenced this issue Sep 21, 2017
Fix issue #1050 - Copy additional python dll to the scripts folder so…
@pypa pypa locked and limited conversation to collaborators Jan 14, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants