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

"The specified module could not be found" on Windows 7 #7

Open
tastyminerals opened this issue Jun 21, 2016 · 11 comments
Open

"The specified module could not be found" on Windows 7 #7

tastyminerals opened this issue Jun 21, 2016 · 11 comments

Comments

@tastyminerals
Copy link

tastyminerals commented Jun 21, 2016

Cloned and installed via python setup.py install on Windows 7 machine.
The machine does not have parallel LPT port. If the error below was triggered by this fact it should say "No parallel port found" or something similar.

Python 2.7.11 (v2.7.11:6d1b6a68f775, Dec  5 2015, 20:32:19) [MSC v.1500 32 bit (Intel)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> import parallel
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "C:\Python27\lib\site-packages\pyparallel-0.2.2-py2.7.egg\parallel\__init__.py", line 13, in <module>
    from parallel.parallelwin32 import Parallel  # noqa
  File "C:\Python27\lib\site-packages\pyparallel-0.2.2-py2.7.egg\parallel\parallelwin32.py", line 60, in <module>
    _pyparallel = ctypes.windll.simpleio
  File "C:\Python27\lib\ctypes\__init__.py", line 435, in __getattr__
    dll = self._dlltype(name)
  File "C:\Python27\lib\ctypes\__init__.py", line 365, in __init__
    self._handle = _dlopen(self._name, mode)
WindowsError: [Error 126] The specified module could not be found
@tastyminerals tastyminerals changed the title What does "The specified module could not be found" mean on Windows 7? "The specified module could not be found" mean on Windows 7 Jun 21, 2016
@tastyminerals tastyminerals changed the title "The specified module could not be found" mean on Windows 7 "The specified module could not be found" on Windows 7 Jun 21, 2016
@zsquareplusc
Copy link
Member

There is a src/win32 directory with the sources for the missing simpleio library. Actually, there is also a binary checked in, that could be copied to the same directory as the module. However to use it you also need to install the giveio driver. The sources are also there, but no binary. There is an installer on the old page https://sourceforge.net/projects/pyserial/files/pyparallel/giveio/ but only supports 32 bit windows.

@tastyminerals
Copy link
Author

tastyminerals commented Jun 28, 2016

So, it means that pyparallel won't work on x64 machine?
Cause even after installing inpout32.dll on my windows 7 x64 machine I get crashes from pyparallel while psychopy.parallel imports parallel correctly.

Thing is, I am trying to send one byte from one machine to the other:

from psychopy import parallel
port = parallel.ParallelPort(address="0xC010")
port.setData(0x02) 

And then receive it on the other:

from psychopy import parallel
port = parallel.ParallelPort(address="0xEC00")
port.readData()
> 0

So, I am probably missing something here.

@tastyminerals tastyminerals reopened this Jun 28, 2016
@zsquareplusc
Copy link
Member

psychopy seems to have its own implementation for the parallel port, I don't think it has anything to do with pyparallel?!

A german computer magazine had an article on how to get giveio running (paywalled):
http://www.heise.de/ct/ausgabe/2015-24-Direktzugriffe-auf-I-O-Ports-unter-aktuellem-Windows-2852706.html

@tastyminerals
Copy link
Author

tastyminerals commented Jun 30, 2016

                                                                                  Interesting, stackoverflow ppl said psychopy used pyparallel under the hood.. At the same time, it didn't work for me. I mean setPin(3, 1) on one machine and then readPin(3) on the other returned zero.‎ So, I think something is wrong with psychopy.parallel. I shall try to install pyparallel again tomorrow on win 7 x64 and see how it goes.                                                                                                                                                                                                                                                                                                                                        

@zsquareplusc
Copy link
Member

Well, looking at https://github.com/psychopy/psychopy/blob/master/psychopy/parallel/__init__.py looks like different code and no sign of pyparallel.

reading from the parallel port may only work in ECP/EPP mode and not in the older simple parallel port mode. back in the dark ages, you had to set up that in the BIOS.

@tastyminerals
Copy link
Author

tastyminerals commented Jul 1, 2016

Well, what I've read here about this issue tells me that it is not possible to run pyparallel on Windows 7 x64 without messing with switching Windows into test mode where one can actually load the unsigned giveio driver. Unfortunately I can't do anything this hacky on a machine with some expensive propitiatory soft :(

@zsquareplusc
Copy link
Member

It may be easier to use an external hardware such as a pyBoard (can be connected via USB) or a Raspberry Pi (e.g.via Ethernet).

@tastyminerals
Copy link
Author

tastyminerals commented Jul 4, 2016

I see. Thanks it is however not possible currently.
I have tried everything using inpout32.dll as well as inpout32x64.dll. Using psychopy.parallel and just accessing the ports via from ctypes import windll. Nothing worked.
I can set the pins locally with:

windll.inpout32.Out32(49168, 120)
windll.inpout32.Inp32(49168)
> 120

But reading the pins on the other connected machine gives nothing:

windll.inptout32.Inp32(60416)
> 0

I think I shall try messing with signing the drivers needed for pyparallel but a few months later.

@eadmaster
Copy link

eadmaster commented May 15, 2017

actually there is a giveio port for 64-bit Windows here and another build here.
I've tried installing both with the command
sc create GiveIO type= kernel binPath= C:\Windows\System32\giveio.sys start= auto
but they fail to start:
Windows cannot verify the digital signature for this file. A recent hardware or software change might have installed a file that is signed incorrectly or damaged, or that might be malicious software from an unknown source.

@mcprat
Copy link

mcprat commented Apr 10, 2019

I have giveio 64-bit working on my Windows 10 system (verified with another program), I got it from here:

https://www-user.tu-chemnitz.de/~heha/viewzip.cgi/hs/giveio64.zip/

@eadmaster I'm guessing that the script included to install is essential compared to the service create command you tried to use. Maybe looking at that script would help you fix your command

The batch for installing it there is pretty much identical to the one already in this git
https://github.com/pyserial/pyparallel/blob/master/src/win32/install_giveio.bat

@mcprat
Copy link

mcprat commented Apr 10, 2019

However, I am still getting this same error, but its because simpleio.dll can't be found...

@hoechenberger I see your commit here...
3c6ee5e

but I installed using python -m pip install pyparallel and it never came with any DLLs at all. Is something wrong? Or am I expected to rather clone this git instead of using PyPI?

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

4 participants