dll load failed while importing socket параметр задан неверно

Python: Модуль установлен, но ImportError: DLL load failed: Не найден указанный модуль

Пытаюсь установить библиотеку DLIB http://dlib.net/.

отлично устанавливается и работает, но как я понял не использует технологию CUDA. Не один день я потратил на эту компиляцию и установку, поэтому покажу последовательность установки, вдруг кто с тем же столкнется:

Когда устанавливал со всеми этими зависимостями, то в лог писалось что версия моей VS не подходит, то до этого где-то вычитал что такое бывает и можно подредактировать чтоб обойти это ограничение.

Поэтому пошел сюда

C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v9.2\include\crt\host_config.h

И на 131 строчки, не помню что там было, что-то типо если версия не ниже и не выше, то сделал не ниже и все, а точнее заменил на эту строку:

Теперь распишу последовательность действий:

Здесь все отлично собралось без ошибок, и в логе было видно что CUDA Enabling, в отличие если бы устанавливал по официальной документации.

Далее устанавливаю в Python:

После не быстрой и сильно загружающей систему компиляции, было видно что так же CUDA Enabling и в конце зеленым Успешно установлено и библиотека скопирована в директорию:

dll load failed while importing socket параметр задан неверно

После не большой радости что наконец-то установил, вылезло вот что: dll load failed while importing socket параметр задан неверно

Источник

How to fix «ImportError: DLL load failed» while importing win32api

I’m setting up an autoclicker in Python 3.8 and I need win32api for GetAsyncKeyState but it always gives me this error:

I’m on Windows 10 Home 64x. I’ve already tried

I expect the output to be none, but the actual output is always that error ^^

dll load failed while importing socket параметр задан неверно

18 Answers 18

Solved

If you are working in a miniconda on conda environment. You could just install pywin32 using conda instead of pip.

This solved my problem:

dll load failed while importing socket параметр задан неверно

dll load failed while importing socket параметр задан неверно

dll load failed while importing socket параметр задан неверно

edit: User @JoyfulPanda gave a warning:

For me, it worked by downgrading my pywin32 from version 227 to version 224. Just type the following command on any shell in administrator mode:

dll load failed while importing socket параметр задан неверно

dll load failed while importing socket параметр задан неверно

conda install pywin32 worked for me. I am using conda distribution and my virtual env is using Python 3.8

This happens when Lib\site-packages\pywin32_system32 is not in the list of directories to search for DLL (PATH environment variable).

pywin32 (or one of its dependencies) adds this path at runtime to the PATH variable. If this is failing, or another component is overriding the PATH after it’s been set by pywin32, you will get the given error (ImportError: DLL load failed while importing win32api).

You can try to extend the PATH variable in the shell before starting Python.

On Unix like systems:

If that doesn’t work, then the PATH maybe overridden within the Python program at runtime. Add the following line to your program just before pywin32 is used to verify its value:

As a last resort, you can extend the PATH variable before pywin32 is loaded:

Источник

DLL load failed when importing PyQt5

I have installed PyQt5 on windows platform and and getting an importError: DLL load failed.

I have installed pyqt5 using the command

My Python version is as follows:

The import Error is as follows:

17 Answers 17

It is because of missing Python3.dll (stub dll, that re-exports Python3x.dll functions, so that one version of extension can work for multiple versions of python).

If your Python distro doesn’t bundle python3.dll, you can try one from WinPython (https://winpython.github.io/).

At least the 2017/04/01 versions should have it.

2) Extract to some temp directory, take the python3.dll and stick it into your python dir, next to the python3x.dll.

3) Enjoy working QT

I know the topic is old but I have also had this problem with the newest version of PyQT 5.11 but I’ve downgraded it to 5.9 via:

and it has solved the issue.

dll load failed while importing socket параметр задан неверно

In my case, I had Windows 10 32-bits and Python 3.7.2. Using PyQt5 5.11 installed via pip I got this error:

I ended up installing 5.10 and had the following error:

After setting QT_DEBUG_PLUGINS and even plugin path with:

I realised that the dll qwindows.dll was searched in the right path where it resides.

In Windows 10 using Python 3.6 I fixed this error going through the following steps:

1) Install PyQt5 with pip install pyqt5

2) As explained in this Microsoft website, I modified my Visual Studio 2017 Community installation enabling «Python native development tools»

dll load failed while importing socket параметр задан неверно

3) Copy python3.dll from C:\Program Files (x86)\Microsoft Visual Studio\Shared\Python36_64 to C:\IntelPython3\Lib\site-packages\PyQt5 (check your directory)

dll load failed while importing socket параметр задан неверно

I had the same issue.

The problem was that my PySide2 version was different from PyQt5 version (PySide2: 5.12, PyQt5: 5.14). I upgraded PySide2 to 5.14 and it worked for me. (Python 3.6.5)

pip install PySide2==5.14

dll load failed while importing socket параметр задан неверно

I could manage to fix it for my conda environment (conda 4.6.11, python 3.6) I was struggling with this issue for a long time, trying all the fixes suggested here. In the end, I figured it out! Use pip3 install instead conda install (my conda seems to perform poorly), even in conda environment (pip3, not just pip, pip didn’t work for me).

I found an alternative fix.

I was using a virtualenv because PyCharm had made one for me and I didn’t know better. I had installed PyQt5 in that virtualenv.

I switched to using no virtualenv, and installed PyQt5 in the global Python dir. That fixed it.

This can also happen when you have a version of Anaconda installed which comes with PyQt5 and you overshadow that package with a pip installed version. Uninstalling the pip installed version corrected the problem for me.

Solution

this is not a permanent fix but it worked for me hope it works for you too @Miloslav Raus answer didn’t work for me

The answer is quite simple sometimes. Went through a lot of headaches because the application was running smoothly before restarting my computer. However, I just said to myself, maybe windows just can’t load the DLL module? So I restarted my computer again and ran again.

Worked perfectly. Hope, it helped someone.

dll load failed while importing socket параметр задан неверно

dll load failed while importing socket параметр задан неверно

Update 2020-06

On a newborn Windows 10 64 Pro with a shiny new Python 3.8 64 and pipenv install pyside2 I got the cursed «DLL load failed». The double-verified solution is an underestimated dependency on the Microsoft Visual C++ Runtime. A foolproof installer is available at https://aka.ms/vs/16/release/vc_redist.x64.exe

Versions 5.13 to 5.15 are running out of the box now as soon as the runtime was installed.

dll load failed while importing socket параметр задан неверно

If you have tried all/most of the above and still gets no where. Here is the solution.

Firstly, exclude the virtual environment issues by checking the PyQt5 path. Open a Windows terminal, and type below

Now that you have seen the PyQt5 path that the default python recognizes (before __init__.py ), check that in File Browser and you should find the PyQt5 directory. It is fine, and the DLL import error is not due to this issue!

If the DLL cannot be imported problem persists, it is because your Windows lacks higher Visual C++ runtime environment. Yes, PyQt5 for Windows is built on Visual C++ 2015-2019. Just download and install that patch to your Windows and restart, problem solved.

Источник

DLL load failed error when importing cv2

I have installed opencv on my windows machine using python 3.6 without any issues, using:

but when I try to import cv2 I get the following error

It says cv2 doesn’t work with python 3 I was wondering if this has been fixed or if there is a way around it

dll load failed while importing socket параметр задан неверно

23 Answers 23

I took a lot of time to solve this error! Run command

dll load failed while importing socket параметр задан неверно

I think it would be easier.

Update on 2017-09-15:

Update on 2018-02-15:

Update on 2018-06-19:

Update on 2018-10-03:

Update on 2019-01-30:

OpenCV 4.0.1 wheel files are now available in the unofficial site with CPython 3.5/3.6/3.7 support.

Update on 2019-06-10:

OpenCV 3.4.6 and OpenCV 4.1.0 wheel files are now available in the unofficial site with CPython 3.5/3.6/3.7 support.

You can fix this issue by copying python3.dll file to Anaconda3 folder (where python.exe is located)

How to get «python3.dll»

But if you can move to Anaconda with python 3.6 you will not face this issue. If it is possible for you, then it is the recommended way..

dll load failed while importing socket параметр задан неверно

Hence you have to manually install the features so that you can get dll related to window media service.

1.Turn windows features on or off

2.Skip the roles screen and directly go to Feature screen

3.Select «Desktop Experience» under «User Interfaces and Infrastructure»

After this all required dll of media services for opencv would be available.

So if you are planning to run your code in cloud(Window Server) then please dont forget to select Desktop Experience feature.

I ran into this problem on Windows 10 (N) with a new Anaconda installation based on Python 3.7 (OpenCV version 4.0). None of the above advice helped (such as installing OpenCV from the unofficial site nor installing VC Redistributable).

So I installed Media Feature Pack for N versions of Windows 10 and voilà, the issue was resolved!

dll load failed while importing socket параметр задан неверно

After spending too much time on this issue and trying out all different answers, here is what found:

The accepted answer by @thewaywewere is no longer applicable. I think this was applicable when opencv-python module still wasn’t available.

This is indeed a bug in Anaconda 4.2 because they forgot to ship python3.dll. They have fixed this in next releases but unfortunately 4.2 is the last release with Python 3.5 as default. If you are stuck with Python 3.5 (for example VS2015 is only aware of versions up to 3.5) then you must manually download python3.dll as described in answer by @Ramesh-X.

If you can move on to Python 3.6 (which at present bit difficult if you are using OpenCV and VS2015) then just install latest Anaconda version and you don’t have to deal with any of these.

dll load failed while importing socket параметр задан неверно

There are many questions on that and many suggestions. None of them helped me for the recent Opencv 3.4.16 and Python 3.6/3.7. Finally I switched to Pyhon 2.7.15 and installed opencv 3.1.0. The DLL-problem was solved.

When I look in cv2.pyd with dependency walker, the 3.1 has no dependency to one missing dll. Opencv 3.4 has this missing dependency to this dll:

may be this is the problem.

P.S.: I have Win7 pofessional 64Bit, 32Bit Python 2.7.15

So if my environment was called fubar first make sure every instance is deactivated (including any IDEs that are using it). Then remove it:

Now I simply recreate my environment and add opencv first:

And then go from there. First open python and make sure import cv2 works. Then you should be on your way. Note I always (always) install Spyder last as it tends to screw things up when I don’t.

Note, if that doesn’t work, we have had some cases where people have to uninstall and reinstall Anaconda, and then things worked. Obviously a last resort.

dll load failed while importing socket параметр задан неверно

I had the same issue when installing opencv 2.4.13 on Anaconda3 (Python 3.6). I managed to fix this issue by reverting to Anaconda2 (Python 2.7)

this happens because the compiler or the interpreter is finding more than one package of the file, delete all the number of same package you have and then keep only one and then try to install. It serves

The issue is due to the missing python3.dll file in Anaconda3.

To fix the issue, you should simply copy the python3.dll to C:\Program Files\Anaconda3 (or wherever your Anaconda3 is installed).

You can get the python3.dll by downloading the binaries provided at the bottom of the Python’s Release page and extracting the python3.dll from the ZIP file.

dll load failed while importing socket параметр задан неверно

I had the same issue with python 3.6(Anaconda3) and OpenCV 3.4.1 for spyder to work. Even after copying cv2.pyd into Anaconda3 Users/home/Anaconda3/Lib/site-packages, it didn’t work.

But found a solution

Later I installed OpenCV and Dlib on Anaconda and copied the generated cv2.cp36-win_amd64.pyd and dlib.cp36-win_amd64.pyd into Anaconda3 Users/home/Anaconda3/Lib/site-packages. These can be copied from environment folder C:\Users\home\Anaconda3\envs\opencv\Lib\site-packages.

Finally spyder started to work

dll load failed while importing socket параметр задан неверно

In my case a major update of Windows 10 removed some Windows packages, so other methods (reinstalling opencv etc.) did not help. To fix it, install:

Both need restart of PC.

dll load failed while importing socket параметр задан неверно

I have the same problem. when I install WinPython programming, and run opencv after copy the cv2.pyd file from my opencv directory, it will be like this: C:\Users. \Downloads\opencv\build\python\2.7\x64, x64 or x86 is depend on your 32 or 64 bit devices. and paste to C:\Users. \Downloads\WinPython-64bit-3.5.4.1Qt5\python-3.5.4.amd64\Lib\site-packages, I prefer the previous python 3.5 than 3.6. Because when I «import cv2» installed (python 3.6) it shows directly: «ImportError: DLL load failed: The specified module could not be found» Then I install python 3.5 and open WinPyhton Command prompt and type «pip install opencv-python».

The command prompt download opencv automatically, it shows the process like this «Successfully installed opencv-python-3.3.0.10»

Finally, I try to run open cv by type «import cv2», it works i try to type «cv2.version«, and shows: ‘3.3.0’

Under Winpython : the Winpython-64bit-. /python_. /DLLs directory the file cv2.pyd should be renamed to _cv2.pyd

dll load failed while importing socket параметр задан неверно

(base) C:\WINDOWS\system32>conda install C:\Users\Todd\Downloads\opencv3-3.1.0-py35_0.tar.bz2

I ran this command from anaconda terminal after I downloaded the version from https://anaconda.org/menpo/opencv3/files

This is the only way I could get cv2 to work and I tried everything for two days.

If this helps someone, on official python 3.6 windows docker image, to make this thing work I had to copy following libraries from my desktop:

Please Remember if you want to install python package/libraries for windows,

Step 1:

Search for your package, download dependent version 2.7 or 3.6 you can find it under Downloads/your_package_version.whl its called python wheel

Step 2:

Now install using pip,

this will install without any error.

I had the same problem and spent 3 full days wrestling with it. I tried everything suggested: upgrading pip, updating Visual C++, updating Anaconda, manually downloading files and basically every solution I could find on the web. Here’s what finally worked maybe it’ll help someone else:

1- I ditched Python 3 and Anaconda-based downloads since I noticed they had several problems and downloaded Python 2.7.16 64-bits instead.

2- Navigated to where Pip was located on my drive (for me the path is C:\Python27\Scripts) highlighted the path by selecting it, and typed «cmd» then enter so the Command Prompt opens on that path (I noticed skipping this usually brings about a couple errors)

4- Downloaded the appropriate Wheel file from https://www.lfd.uci.edu/

Источник

ImportError: DLL load failed while importing _ctypes: The parameter is incorrect #3332

Comments

bobvargas commented Nov 11, 2020 •

Bug Report

Streamlink glitching out on the latest nightly

Description

Hi when I use the latest nightly build of streamlink somehow I get this when I try a URL

Expected / Actual behavior

Reproduction steps / Explicit stream URLs to test

Log output

Additional comments, etc.

The text was updated successfully, but these errors were encountered:

We are unable to convert the task to an issue at this time. Please try again.

The issue was successfully created but we are unable to update the comment at this time.

bastimeyer commented Nov 11, 2020

ImportError: DLL load failed while importing _socket: The parameter is incorrect

The installer and Python 3.8 env are however working fine in my W10 VM. If you are using an older version of Windows and are thus seeing this error (assuming the linked bugreports are correct), it’s not our problem and you should update your system.

Just to be clear, we don’t support any versions of Windows which are unsupported by MS (which includes 7), and the downgrade of the Streamlink installer to Python 3.8 in #3330 was merely done to prevent more issues from being opend by Windows 7 users where Python 3.8 is supported and (supposed to be) working correctly.

Источник

Добавить комментарий

Ваш адрес email не будет опубликован. Обязательные поля помечены *