Does twisted.internet.serialport 17.1.0 work on Windows? - pyserial

I am trying to use twisted.internet.serial on Windows and it always fails to create with the message :
"File "C:\Program Files\Python36\lib\site-packages\twisted\internet_win32seria
lport.py", line 65, in _finishPortSetup
flags, comstat = win32file.ClearCommError(self._serial.hComPort)
AttributeError: 'Serial' object has no attribute 'hComPort'"
I have tried on Windows 10 x64 as well as Windows 7 x64, running as administrator, with Python 3.6.1 and Python 2.7.13.
I have installed twisted 17.1.0, PySerial 3.3, pywin32 221.
It appears to me that PySerial has been revised at some point to privatize the com port handle as self._port_handle rather than self.hComPort which twisted is expecting.
Is this a known issue? Is there a work-around? Are twisted and/or PySerial being improved w/r/t this issue?
Thanks, Dick

To answer my own question, I have discovered that this issue has been known for over a year. See https://twistedmatrix.com/trac/ticket/8159 .
There is a work-around: it is patch #2 which can be found at the link above.
No word yet as to whether the twisted folks has put any priority on releasing this patch into the mainline.

While Twisted is not updated to use newer PySerial versions, I have resolved this by downgrading PySerial to 'pyserial<3.0' (which installs pyserial==2.7).
pip install pyserial<3.0

Related

"Cloning" a program from a CentOS 7 machine to another

I am in need of working with a specific version of the text editor Lyx, the 1.3.3, on a CentOS 7 environment. I found the .rpm package and some sort of source code, but as it's a very old software, many library are obsolete and cannot be found when installing from the rpm file and for some reasons no c++ compiler I used seems to be good to compile the source code.
Now my question: I do have a CentOS virtual machine with this specific version of Lyx installed properly. Is there a way to "clone" or somehow copy it into my CentOS main partition? Or, if this is too barbaric, how can I extract/install from the VM CentOS the libraries I need?
I apologize if my question doesn't make much sense, I am by no means an expert of Linux distros and I might have some misconceptions brought over from Windows.

libtorrent error on Windows XP

I'm trying to run a program on Windows XP using libtorrent 1.1.5 (compiled via boost 1.65.1) and get the error "The entry point to the CreateSemaphoreExW procedure was not found in the KERNEL32.dll DLL.". On Windows 7+ this works fine. How can I fix this error?
UPDATE:
_WIN32_WINNT=0x0501 solved the problem
The answer is simple- you can not fix it. Take a look at the official documentation.
https://msdn.microsoft.com/en-us/library/windows/desktop/ms682446(v=vs.85).aspx
Minimum supported client: Windows Vista. You can try to download a kernel32.dll from windows 7 and put it into the application directory, but I doubt it would work.

Perl 5.22 CLI 2.03

I am facing problem for accessing my serial port device from Control::CLI( ver 2.03) on Perl 5.22. Issue is connection gets established but I can't write on the port.
The same code was working well with Control::CLI( ver 1.03) on Perl 5.14
Please help.
Thanks.
Unfortunately there isn't more of information to go on but the problem sounds like it might be one of two areas:
1) there might be issues with the newer version of Control::CLI that you are using. This would be something to ask the maintainer of Control::CLI about.
Chances are you might need to modify your existing code.
2) the OS that you are running 5.22 on. What's not clear is if you ran 5.14 on an older version of Windows (ie, Win 7, Win XP) and are trying to run your script with 5.22 on a newer version (ie, Win 10).
Sorry that I can't give an exact answer but these would be areas I would advise looking into to begin troubleshooting.

pgAdmin 4 not starting on Windows 10 64bit

After a fresh install of postgres 9.6.0.1 for Windows 10 64bit I am not able to get pgAdmin 4 starting.
First it throws an fatal error message:
After OK, that message appears:
Is there anything wrong? because after OK - the program won't start.
What can I do to get pgadmin 4 running? What should I enter in Python Path and what in Application Path?
I have found now the problem, it was the Java installation on which pgadmin 4 depend heavily.
In Windows when installing Java 8 (Java SE in this case) you do not have to use JAVA_HOME and JAVA_JRE anylonger and you can install java with default path settings (with the version number)
So I installed JAVA SDK 8 32 and 64bit and pgadmin start up normally.
The PATH variable includes only C:\ProgramData\Oracle\Java\javapath, thats all and let you use allways the latest version of java you installed.
In my case, I installed pgAdmin 4 v4.25 (released Aug. 20, 2020) . It solved my issue .
I had the same problem. I think, the installation of Visual C++ 2013 Redistributable is the source.
I fixed it uninstalling pgAdmin 4 and installing it again.
It tried to install Visual C++ 2013 Redistributable again, but it was already installed and now it works.
Hope this helps.
Try to install pgamin 4.5.1, it works for me (w10 x64) pgadmin 4.1.5
After struggling for weeks with this problem I found a solution. In my case I have Anaconda installed and maybe it affects PgAdmin in some way, I don't know. In order to start PgAdmin I followed these steps:
Open cmd and move to C:\Program Files\PostgreSQL\11\pgAdmin 4\web
Run pgAdmin4.py with your Python distribution. I had to install several libraries.
In my case, an error appeared, I needed to change Line #32 of C:\Program Files\PostgreSQL\11\pgAdmin 4\web\pgadmin\browser\__init__.py. More precisely:
from flask_security.views import _security, _commit, default_render_json, _ctx to
from flask_security.views import _security, _commit, _render_json, _ctx
Last, I needed to edited line socket module from Python libraries, gethostbyaddr(name) found non-ASCII symbols in the host name of my computer, I don't have any of them :S. Well, I changed line #687
hostname, aliases, ipaddrs = gethostbyaddr(name) to
hostname, aliases, ipaddrs = gethostbyaddr("")
After all of these steps I run pgAdmin4.py again and it worked.
Hope it helps.
For me there was no way to make it work (pgAdmin4 Version 4.21 that comes with Postgres 11.8 on Windows 10 x64). I really tried every possible solution.
So I gave up and found pgAdmin3 Redux: https://tokavuh.com/pgAdmin3Redux/ that supports Postgres 11, too.
You will probably have problems starting it, because of missing dll's from some Visual C++ Redistributable version I could not find out, but fortunately you will find these missing dll's on https://www.dll-files.com, just search them there as errors pops up.

Debugging with EPIC, Indigo and Windows 7 64-bit

I'm trying to get the EPIC debugger working with the following setup:
Eclipse Indigo
ActivePerl 5.14.2
EPIC 0.6.44
Windows 7, 64-bit
When I start the debugger, I get the following message:
Use of uninitialized value in subroutine dereference at (null) line 1.
perl5db.pl did not return a true value.
BEGIN failed--compilation aborted.
I've read everything I can find on this well-known bug (SourceForge ID 2907155) and tried all of the solutions, to no avail.
Initially, I was unable to install PadWalker (no version available that is compatible with Windows 7, 64-bit), but then I WAS able to install it by starting the PPM and directly selecting this package from the list of all available packages.
I also installed PathTools (recommended as a possible fix in the bug report). That caused a rollback of Cwd.pm from 3.6 to 3.3, but that didn't seem critical.
I then edited Cwd.pm (again, as suggested in the bug report) and removed the eval that is considered the root of the problem.
I closed and re-opened Eclipse. But, I still get the same error.
So, I am out of ideas. Maybe some of the fixes are contra-indicated?
Has anyone got the debugger working for this configuration?
Thanks.
OK, I solved the problem, and here's how I think I did it (tried a lot of things - including Strawberry, so I'm not sure exactly what worked):
I'm staying with ActivePerl. EPIC tells you to edit the cwd.pm file, which I did, but it didn't help. I later saw that the cwd.pm file was in two places:
- C:\Perl64\lib
- C:\Perl64\site\lib
I had only changed the version in C:\Perl64\lib. When I also changed the version in C:\Perl64\site\lib, everything work.
Gruß, Kim
Add path of the Perl library folder in Eclipse Include Path.
Go to Eclipse : Eclipse -> Project->Properties->Perl Include Path
Add Perl lib folder : Example: D:\Dwimperl\perl\lib