PyModbusTCP module installation on windows pc - pymodbustcp

Last year, I made a program using the PyModbusTCP module on a raspberry Pi. Now I want to try my programs again on a windows pc but I can't seem to get my installations correct.
Here is some info:
project has a venv folder and a main.py next to it. I am not sure if the main.py has to be in the venv folder or not.
PyModbusTCP has been installed using git cmd with the command "pip3 install pyModbusTCP" and gives me a message "requirement already satisfied..."
Message in console after using a basic program provided by the pymodbustcp dev:
C:\Users\SESA681397\PycharmProjects\pythonProject\venv\Scripts\python.exe C:\Users\SESA681397\PycharmProjects\pythonProject\test.py
Traceback (most recent call last):
File "C:\Users\SESA681397\PycharmProjects\pythonProject\test.py", line 1, in <module>
from pyModbusTCP.client import ModbusClient
ModuleNotFoundError: No module named 'pyModbusTCP'
Thank you for your time reading this, it is probably a stupid problem but i don't know it.
I tried to get the folder correctly and see if pymodbustcp module is correctly installed.
Tried to see if the module is installed and if my previous programs worked.

Related

Pygame auto-py-to-exe gets stuck after selecting script location [duplicate]

I try to install Auto-Py-to-exe but they have a lot of error appear during the installation but at the end it sais successfully installed, see picture below.
I have windows 10pro, PyCharm community 2020.3.3, and i use python 3.9.1 for almost all my projects.
I have uninstall auto-Py-to-exe, piwin, PYpiwin32, pywin32, PyInstaller. Close all the system and reboot, re-install all these module, but nothing seem to work. It the same error when i use Python 3.6 or 3.7. the same error arrived in PyCharm terminal and in the promt(cmd) window terminal.
C:\Windows\system32>auto-py-to-exe
Traceback (most recent call last):
File "c:\users\mélissa\appdata\local\programs\python\python39\lib\runpy.py", line 197, in _run_module_as_main
return _run_code(code, main_globals, None, File "c:\users\mélissa\appdata\local\programs\python\python39\lib\runpy.py", line 87, in _run_code
exec(code, run_globals) File "C:\Users\Mélissa\AppData\Local\Programs\Python\Python39\Scripts\auto-py-to-exe.exe\__main__.py", line 7, in <module>
File "c:\users\mélissa\appdata\local\programs\python\python39\lib\site-packages\auto_py_to_exe\__main__.py", line 291, in run
if eel.chrome.get_instance_path() is not None and not disable_chrome:AttributeError: module 'eel.chrome' has no attribute 'get_instance_path'
C:\Windows\system32>
I have made the update of PIP, EEL, PYInstaller( the upper version they want to install is 3.2.1, the other fail), gevent and greenlet but i receive always the same error message.
I don't know what to do. I have check here for answer or direction to resolve my problem but i find nothing for now.
the error message in PYCharm, it the same in window terminal
It appears, while looking at the traceback, that the error is in the source code, and not your own execution. Looking through the auto-py-to-exe GitHub repository files, it seems that the package just uses pyinstaller to convert the python script(s) to executable files. In this case, I would recommend just using pyinstaller itself.
To convetr the .py file to a single file, run:
pyinstaller my_script.py --onefile --windowed
The .exe file will appear in a folder dist/ (created during the build). The build/ folder along with other files created during the process can be deleted.

from flask_mysqldb import MySQL

EDIT: Problem resolved. I was able to finally figure out the problem with some help from another student in the Udemy class along with the answer from Isaac_R here. I had to edit my .bash_profile with the following two lines of code and I am able to install MySQLdb and it is working as intended now. Here are the two lines I added to my .bash_profile
export LIBRARY_PATH=$LIBRARY_PATH:/usr/local/opt/openssl/lib/
export DYLD_LIBRARY_PATH=/usr/local/mysql/lib:$DYLD_LIBRARY_PATH
EDIT #2: I just started another mysql project in a new file, I had to run
pip3 install mysqlclient
before I could install mysqldb, just a heads up to someone who may have this issue like I did.
I am totally new to coding so please excuse my potential ignorance, I am trying my best to learn something new and it was going well until I ran into this issue that I am unable to get passed. I am on a Mac with 10.15.4 in python3.8.2 trying to create a MySQL database in order to use in a blog I am attempting to build. I have installed the mysql client along with pip3 install flask-mysqldb. I get successful conformation of the install, here is where my problems start. In Atom I am using the command from ''flask_mysqldb import MySQL'' to which I receive the error of the following
Traceback (most recent call last):
File "app.py", line 3, in <module>
from flask_mysqldb import MySQL
File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/flask_mysqldb/__init__.py", line 1,
in <module>
import MySQLdb
File "IndentationError: unexpected indent
(venv) tylernelson#Tylers-MacBook-Air My Project % python3 app.py
Traceback (most recent call last):
File "app.py", line 3, in <module>
from flask_mysqldb import MySQL
File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/flask_mysqldb/__init__.py", line 1,
in <module>
import MySQLdb
File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/MySQLdb/__init__.py", line 18, in <
module>
from . import _mysql
ImportError: dlopen(/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/MySQLdb/_mysql.cpython-
38-darwin.so, 2): Library not loaded: #rpath/libmysqlclient.21.dylib
Referenced from: /Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/MySQLdb/_mysql.cpython-3
8-darwin.so
Reason: image not found"
I am able to post my entire (all be it super short) code file also if that will help resolve the problem. Thank you so much for your ideas and help!
I went thru the same issue, I found the best solutions within this question:
Python mysqldb: Library not loaded: libmysqlclient.18.dylib
I will recommend you to go thru all the options listed there, in my case run the command
export DYLD_LIBRARY_PATH=/usr/local/mysql/lib:$DYLD_LIBRARY_PATH
solved my issues, most of the time when mysql gets installed the mysql directory should be renamed to just mysql.

TortoiseHg error running HG

I'm running into an error when pushing a local repository to the master repository located on a network share in Windows 7. I've added a hook on the master repository to perform "hg update" on push. When I'm running push from the local repository in the TortoiseHg, I get this error in the console:
Traceback (most recent call last):
File "c:\Python26\lib\site-packages\py2exe\boot_common.py", line 92, in <module>
ImportError: No module named linecache
Traceback (most recent call last):
File "<install zipextimporter>", line 1, in <module>
ImportError: No module named zipextimporter
Traceback (most recent call last):
File "hg", line 10, in <module>
ImportError: No module named os
warning: changegroup hook exited with status 255
The push happens, but does not successfully execute the hook. Furthermore, it seems I get this error all the time I run the "hg" command in the command line, except when running it inside the C:\Program Files\TortoiseHg directory. I've put the "C:\Program Files\TortoiseHg" in the PATH environment variable, but without any success. The system is Windows 7 x64.
In general TortoiseHg seem to work, like commit, update, push, pull... But finer details like hooks seem to not work. I've installed Tortoise 3.5.1 ONLY, without any Mercurial or Python. Here is where I've installed it from:
http://bitbucket.org/tortoisehg/files/downloads/tortoisehg-3.5.1-x64.msi
http://tortoisehg.bitbucket.io/download/index.html
Can somebody help me? I've seen a similar question on StackOverflow, but the person had both Mercurial and TortoiseHg installed.
So, why do I get these errors when running hg in the command line? Why pushing from TortoiseHg GUI doesn't successfully execute the hook on the remote repository?
If traceback is from push-target, then
You have Python 2.6 on it ('File "c:\Python26\lib\site-packages\py2exe\boot_common.py"...')
Mercurial 3.5 (thus - TortoiseHG also) dropped compatibility with Python 2.6, AFAICR, but:
THG uses Python's modules, if $PYTHON part is earlier in PATH and hg called outside THG home (in the latter case bundled with THG modules used); and pwd for running hook is always repo-dir
Change order in PATH (TBT!) or update Python to 2.7 or remove current Python from PATH
Why pushing from TortoiseHg GUI doesn't successfully execute the hook on the remote repository?
Because:
hook is push-target task, unrelated to push-source
You have troubles with hg (called in hook) on server's side, which are not related to client's THG

Exception raised when running ipython notebook

I used to have ipython notebook working correctly in fedora, but then tried to get ipython notebook for julia with Pkg.build("IJulia") and Pkg.add("IJulia").
After doing this and updating my ipython version with pip I could not run ipython notebook anymore, the next exception was raised over and over again:
ERROR:root:Exception in I/O handler for fd 6
Traceback (most recent call last):
File "/usr/lib64/python2.7/site-packages/zmq/eventloop/ioloop.py", line 346, in start
self._handlers[fd](fd, events)
KeyError: 6
^C2014-08-12 22:51:35.024 [NotebookApp] CRITICAL | received signal 2, stopping
Any help would be very much appreciated.
Thanks in advance :)
Getting IJulia to work is lot easier now, Pkg.add("IJulia") will search for jupyter or ipython in PATH, if not found it will use Conda.jl to install the dependencies. Another option which was tried successfully by the OP is to separately install Jupyter(which comes along Anaconda) to system path, and then install IJulia. Then should be able to open the notebooks by,
julia>using IJulia
julia>notebook
Alternatively you can open a notebook by running jupyter notebook in the command line.
PS : Credits to OP and commenters.

Mercurial produces strange messages

I'm typing hg st as my regular ritual when working with Mercurial.
But today Mercurial is acting up on me, it produces
Could not find platform independent libraries <prefix>
Consider setting $PYTHONHOME to <prefix>[:<exec_prefix>]
'import site' failed; use -v for traceback
Traceback (most recent call last):
File "/usr/local/bin/hg", line 10, in <module>
import os
ImportError: No module named os
This same error appear when I type hg branches and any other hg commands.
Do you know what is going on and how to solve this problem?
EDIT:
So I was running Mac OS X, and working with Xcode.
I have several Xcode versions in the machine,
some of them are Xcode4 (including Xcode beta versions).
I remember when I couldn't uninstall Xcode4 from script
I delete the Xcode4 folder manually, and then the error appear every time I type hg something.
EDIT:
I uninstalled all Xcode versions, and Pythons still not working so I reInstall the OS, now it works.
Your Python installation is broken.
I don't know exactly what you've done for this to happen, but Python is unable to find the os module, this has nothing specific to do with Mercurial.
Depending on your operating system, the easiest way to resolve this will be to reinstall Python from scratch.