Re: pywin32 WAS: (no subject)

Dennis Lee Bieber <[email protected]>
Newsgroups gmane.comp.python.windows
Organization IISS Elusive Unicorn
Message-ID <[email protected]>
On Wed, 9 Jun 2021 17:41:44 -0600, Fadi Ibrahim <[email protected]>
declaimed the following:


>1- The Pywin32 seems to indicate 2 things, a Python IDE and it is also an
>extension to be added to Python using pip install pywin32 for instance
>right?  Please kindly let me know if my understanding is correct.
>

	I've always installed ActiveState builds of Python, and they provide
pywin32 and the PythonWin IDE as standard, so I can not speak of what
separate installs provide. Check your system for a PythonWin file. A la...

Windows PowerShell
Copyright (C) Microsoft Corporation. All rights reserved.

Try the new cross-platform PowerShell https://aka.ms/pscore6

C:\Users\Wulfraed> Get-ChildItem -Path "C:\" -Recurse -Name -Filter
"pythonwin.*"
Python38\Lib\site-packages\pythonwin
Python38\Lib\site-packages\pythonwin\Pythonwin.exe

	If you do find pythonwin.exe, you may wish to make a shortcut for it.

>
>2- I am using OpenOPC to read values from an OPC server under the following
>settings:
>- Windows 10 - 64 - bits
>- Python 3.7 64 - bits

	A bit old -- even my 3.8 build is getting stale.

	Just curiosity -- how did you install that build? For one user or all
users; and if all users, did you install in C:\Program Files\ (which means
the install is read-only, and might cause some problems with installing
modules via PIP -- they may be installed for single user in your appdata
directory... I normally install Python at the drive top-level so PIP
installs can go for all users).

>- PyCharm
>- Graybox OPC DA Auto Wrapper x64

	And have you followed all the instructions on
http://gray-box.net/daawrapper.php?lang=en ?

	Have you considered any other OPC interface? Perhaps
https://joseamaita.com/en/openopc-and-python-37-on-windows/
https://github.com/joseamaita/openopc120
https://www.opcconnect.com/tooltech.php#python (which implies it ships WITH
gray-box wrapper)

>- Pyro 4
>- Pywin32 installed via PyCharm
>- Matrikon OPC
>
>
>and I can connect to the Matrikon OPC DA server and browse the tags, but
>when I  try to read a tag ( *opc.read(['Random.Int1']*)) the execution gets
>terminated with the error: *"Process finished with exit code -1073741819
>(0xC0000005)*"
>


	Please cut&paste the exact TEXT (not a screen grab) of the session and
error trace. Don't retype from memory -- I suspect 
			opc.read(['Random.Int1']*)
has a typo -- the * needing to be inside the quoted string, based on
example documentation. A full trace might indicate if your are even using
pywin32 modules (some of the links indicate that pywin32 is optional
depending on exactly what and how you are accessing the servers).

	Have you followed instructions on https://pypi.org/project/pywin32/ In
particular
"""
Note that if you want to use pywin32 for “system wide” features, such as
registering COM objects or implementing Windows Services, then you must run
the following command from an elevated command prompt:

> python Scripts/pywin32_postinstall.py -install
"""

	Elevated command prompt means a command shell in Administrator mode.
And obviously, you'll need to provide the full path to that, or be in the
parent directory that holds Scripts\....

	You might want to pick the pre-built executable directly from
https://github.com/mhammond/pywin32/releases



-- 
	Wulfraed                 Dennis Lee Bieber         AF6VN
	[email protected]    http://wlfraed.microdiversity.freeddns.org/

_______________________________________________
python-win32 mailing list
[email protected]
https://mail.python.org/mailman/listinfo/python-win32
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.