![]() Nothing else in that directory is called anything related to MySQL. The package apparently also contained a C library, which seems to have installed in usr/lib/python3/dist-packages. Running the command which python3 gives the output usr/bin/python3 but running which python gives no output. Defaulting to user installation because normal site-packages is not writeable Collecting mysql-connector-python Downloading mysqlconnectorpython-8.0.33-cp310-cp310-manylinux1x8664.whl (27.4 MB) 27.4/27.4 MB 4.0 MB/s eta 0. ![]() I didn't seem to get any issues during the installation the file python3 is in /usr/bin which is definitely in the path, but seems to be a link to the file python3.5 in the same location. On one similar question, I've seen it suggested that the connector may not have installed properly if python is not in the path. When I try to verify the installation through the Python interpreter using import nnector, I just get the following error: > import nnector It's listed as being compatible with Python 3.5, which is the version I have. deb (obviously I replaced with the actual name). I've just installed the official MySQL connector/python (2.1.7, python3 version) using dpkg -i. I'm running Ubuntu 16.04 LTS, server version. Return _bootstrap._gcd_import(name, package, level)įile "", line 950, in _find_and_load_unlockedįile "", line 205, in _call_with_frames_removedįile "/var/task/application.py", line 6, in įile "/var/task/PIL/Image.I'm very new to Ubuntu/Linux and Python so it's entirely possible I'm missing something obvious here. Self.app_module = importlib.import_module(_MODULE)įile "/var/lang/lib/python3.6/importlib/_init_.py", line 126, in import_module Return LambdaHandler.lambda_handler(event, context)įile "/var/task/handler.py", line 237, in lambda_handlerįile "/var/task/handler.py", line 129, in _init_ ![]() Look for python3.x supported modules as explained here: Python 3.4.0 with MySQL database. Python-MySql ImportError: No module named MySQL closed Ask Question Asked 3 years, 3 months ago. The downside is that youll probably have to convert some code to python2.x. However, I then ended up getting:įile "/var/task/handler.py", line 509, in lambda_handler Run your script using python2.7, that way you wont need to change the MySQL module. Update: Interestingly enough, I tried using "use_precompiled_packages": false and no longer got ModuleNotFoundError: No module named 'mysql'. ![]() Spent a fair amount of time trying to get that to work before giving up. But every time I tried to do python setup.py sdist bdist_wheel I got error: invalid command 'bdist_wheel'. I thought that the issue might be related to Miserlou/Zappa#319, so I tried to create a wheel from the Platform Independent ZIP archive (from MySQL's download page). I am running Zappa from a virtual environment and am using Python 3.6. I get the exact same issue, ModuleNotFoundError: No module named 'mysql' on Lambda (again, it works perfectly locally). From the Connection type list, select the connection type depending on the connection. In the Driver list, leave the default driver option, unless another driver is required for your connection. In the General tab of Data Sources and Drivers dialog right pane, specify the driver and connection type. ![]() I also tried uninstalling mysql-connector-python and instead installed mysql-connector-python-rf via pip install mysql-connector-python-rf. Navigate to Data Source and select MySQL. I'm installing mysql-connector-python from source URL: Everything works fine locally, the error only occurs on Lambda. I'm trying to use MySQL Connector/Python with Zappa but keep getting ModuleNotFoundError: No module named 'mysql' after deploying. Originally from: Miserlou/Zappa#1401 by jsahoo Context ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |