Trying to set up mysql-connector-python and getting error - python-3.x

I have the package installed and it does not show errors until I run it and i get this..
Traceback (most recent call last):
File "/Users/andrewmayes/virtualenv/lib/python3.5/site-packages/dnspython3-1.12.0-py3.5.egg-info/practice.py", line 2, in <module>
import mysql.connector
File "/Users/andrewmayes/virtualenv/lib/python3.5/site-packages/mysql/connector/__init__.py", line 34, in <module>
import _version
ImportError: No module named '_version'
And when I try to upgrade...
Collecting myswl-connector-python
Could not find a version that satisfies the requirement myswl-connector-python (from versions: )
No matching distribution found for myswl-connector-python

Related

'Invalid syntax' error when importing torch (Linux)

I'm trying to install torch under miniconda and simple import torch gives me the following error:
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/vol/tcm17/username/miniconda3/lib/python3.8/site-packages/torch/__init__.py", line 779, in <module>
from .serialization import save, load
File "/vol/tcm17/username/miniconda3/lib/python3.8/site-packages/torch/serialization.py", line 18, in <module>
from typing_extensions import TypeAlias
File "/home/username/.local/lib/python3.8/site-packages/typing_extensions.py", line 880
if stripped_args
Interestingly, if I repeat import torch again the error message changes:
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/vol/tcm17/username/miniconda3/lib/python3.8/site-packages/torch/__init__.py", line 249, in <module>
for name in dir(_C):
NameError: name '_C' is not defined
I'm not using notebooks, python version is 3.8.16, pytorch version is 1.13.1. Miniconda is installed in a local folder (it's a university server so I can only do it like this due to disk space restrictions), the server runs on Ubuntu.
What could possibly be the problem?
The only recommendation I found for similar problems is to install Cython but it didn't help.
Downgraded to python 3.6 and this somehow solved the problem.

Installing Tensorflow on win10 ( installed but showing error while doing import tensorflow as tf)

I am using Windows 10Pro ss of my OS info
Using the latest version of Anaconda, python(version 3.8.3), TensorFlow version information as follows
Name: tensorflow
Version: 2.3.0
I installed Tensorflow CPU.
While importing TensorFlow I have the following errors.
Traceback (most recent call last):
File "C:\Users\Prakash\Anaconda3\lib\site-packages\tensorflow\python\pywrap_tensorflow.py", line 64, in
from tensorflow.python._pywrap_tensorflow_internal import *
ImportError: DLL load failed while importing _pywrap_tensorflow_internal: The specified module could not be found.
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "", line 1, in
File "C:\Users\Prakash\Anaconda3\lib\site-packages\tensorflow_init_.py", line 41, in
from tensorflow.python.tools import module_util as module_util
File "C:\Users\Prakash\Anaconda3\lib\site-packages\tensorflow\python_init.py", line 40, in
from tensorflow.python.eager import context
File "C:\Users\Prakash\Anaconda3\lib\site-packages\tensorflow\python\eager\context.py", line 35, in
from tensorflow.python import pywrap_tfe
File "C:\Users\Prakash\Anaconda3\lib\site-packages\tensorflow\python\pywrap_tfe.py", line 28, in
from tensorflow.python import pywrap_tensorflow
File "C:\Users\Prakash\Anaconda3\lib\site-packages\tensorflow\python\pywrap_tensorflow.py", line 83, in
raise ImportError(msg)
ImportError: Traceback (most recent call last):
File "C:\Users\Prakash\Anaconda3\lib\site-packages\tensorflow\python\pywrap_tensorflow.py", line 64, in
from tensorflow.python._pywrap_tensorflow_internal import *
ImportError: DLL load failed while importing _pywrap_tensorflow_internal: The specified module could not be found.
Failed to load the native TensorFlow runtime.
Screen shot of the error showning
please help me resolve this issue.
comment if any other information is needed

unable to Import package 'from chatbase import Messgae'?

hi there I'm currently facing this issue Unable to installed properly chatbase its give me module error
Traceback (most recent call last): File "<stdin>", line 1, in <module> File "/home/dellvostro/.local/lib/python3.6/site-packages/chatbase/__init__.py", line 18, in <module>
from chatbase.facebook_agent_message import * File "/home/dellvostro/.local/lib/python3.6/site-packages/chatbase/facebook_agent_message.py", line 19, in <module>
from base_message import Message ModuleNotFoundError: No module named 'base_message'
please help me,I m following this link click I was also used both pip and pip3 to installed the package chronological order.
thanks

What is the reasonf for "ModuleNotFoundError: No module named 'engine'" and how to fix it?

This error occurred when I try to run my code:
Traceback (most recent call last):
File "c:\Users\loveislife\Desktop\PyProject\J.A.R.V.I.S - Copy\script.py", line 83, in <module>
import pyttsx
File "C:\Users\loveislife\AppData\Local\Programs\Python\Python37\lib\site-
packages\pyttsx\__init__.py",
line 18, in <module>
from engine import Engine
ModuleNotFoundError: No module named 'engine'.
And this error occurred when I open cmd prompt to import engine:
C:\Users\loveislife>pip install engine
Collecting engine
ERROR: Could not find a version that satisfies the requirement engine (from versions: none)
ERROR: No matching distribution found for engine
How can I fix it?
From google, try installing and importing pyttsx3, which is the updated version for python 3, and it should work.

unable to run a python file because of Module not found error despite sourcing the pythonpath

I have been trying to run a python file using rosrun command but unfortunately I am having this module not found error because of a package named rospkg. Until a day before yesterday, it was all working fine but yesterday, ubuntu18.04 has got some updates out of which an update for ubuntu base was also present, since that update I am having this error.
I have tried to check whether I have installed the respective python-rospkg and its says I already have the latest version. I have also using
echo $PYTHONPATH
to check the sourced paths and they are sourced correct, I am not sure whats causing this error.
the error is as follows
Traceback (most recent call last
File
"/home/microbot/catkin_ws/src/spider/spider_control/control.py",
line 5, in <module>
import roslib
File "/opt/ros/melodic/lib/python2.7/dist-
packages/roslib/__init__.py", line 50, in <module>
from roslib.launcher import load_manifest
File "/opt/ros/melodic/lib/python2.7/dist-
packages/roslib/launcher.py", line 42, in <module>
import rospkg
ModuleNotFoundError: No module named 'rospkg'
The shebang for my is as follows,
#!/usr/bin/python3
When i try to run the file by changing the shebang to
#!/usr/bin/python2.7
I get the following error
Traceback (most recent call last):
File
"/home/microbot/catkin_ws/src/spider/spider_control/control.py",
line 3, in <module>
import tensorflow as tf
ImportError: No module named tensorflow
I have installed tensorflow version 1.14 using pip installation. Can anyone please help me solving this error. Thanks in advance
edit:
I have manually tried to set the python path to /usr/lib/python2.7/dist-packages as when I tried to install python-rospkg, it says the its already instaled in that location. Doing that I am having error importing tensorflow and the error is
`Traceback (most recent call last):
File
"/home/microbot/catkin_ws/src/spider/spider_control/control.py", line
3, in <module>
import tensorflow as tf
File "/home/microbot/.local/lib/python3.6/site-
packages/tensorflow/__init__.py", line 22, in <module>
import inspect as _inspect
File "/usr/lib/python3.6/inspect.py", line 41, in <module>
import linecache
File "/usr/lib/python3.6/linecache.py", line 11, in <module>
import tokenize
File "/usr/lib/python3.6/tokenize.py", line 33, in <module>
import re
File "/usr/lib/python3.6/re.py", line 142, in <module>
class RegexFlag(enum.IntFlag):
AttributeError: module 'enum' has no attribute 'IntFlag'
Error in sys.excepthook:`

Resources