I am getting an error when i try to GET some data with my flask app:
Traceback (most recent call last):
File "~/server/env/lib/python3.9/site-packages/sqlalchemy/util/_collections.py", line 1008, in __call__
return self.registry[key]
KeyError: 6166425600
this traceback ends with :
File "~/server/env/lib/python3.9/site-packages/sqlalchemy/dialects/mysql/mysqldb.py", line 163, in dbapi
return __import__("MySQLdb")
ModuleNotFoundError: No module named 'MySQLdb'
When i try to pip install mysqlclient ( the recommended fix ), i get :
Collecting mysqlclient
Using cached mysqlclient-2.1.0.tar.gz (87 kB)
Preparing metadata (setup.py) ... error
error: subprocess-exited-with-error
× python setup.py egg_info did not run successfully.
│ exit code: 1
╰─> [16 lines of output]
/bin/sh: mysql_config: command not found
/bin/sh: mariadb_config: command not found
/bin/sh: mysql_config: command not found
Traceback (most recent call last):
File "<string>", line 2, in <module>
File "<pip-setuptools-caller>", line 34, in <module>
File "/private/var/folders/j5/b194wjbn32sbqct7crpvcp2w0000gn/T/pip-install-ijejonzz/mysqlclient_841539cf1eed4511a135f8e95cb2be75/setup.py", line 15, in <module>
metadata, options = get_config()
File "/private/var/folders/j5/b194wjbn32sbqct7crpvcp2w0000gn/T/pip-install-ijejonzz/mysqlclient_841539cf1eed4511a135f8e95cb2be75/setup_posix.py", line 70, in get_config
libs = mysql_config("libs")
File "/private/var/folders/j5/b194wjbn32sbqct7crpvcp2w0000gn/T/pip-install-ijejonzz/mysqlclient_841539cf1eed4511a135f8e95cb2be75/setup_posix.py", line 31, in mysql_config
raise OSError("{} not found".format(_mysql_config_path))
OSError: mysql_config not found
mysql_config --version
mariadb_config --version
mysql_config --libs
[end of output]
note: This error originates from a subprocess, and is likely not a problem with pip.
error: metadata-generation-failed
not sure what else to do, outside of the pip install.
Do you have MySQL installed on your machine? Pip is only going to install the python connector, and it is failing because it cannot find MySQL or MariaDB installed locally.
Related
When following the install guide from sparkfun, at the last step when trying to install the package using pip I get these error (with and without sudo).
I am currently running the latest version of raspberry pi os but installed python 3.8 to use with the sparkfun tools.
The sparkfun guide and github pages are included below.
pi#raspberrypi:~/Qwiic_Ublox_Gps_Py/dist $ pip3.8 install sparkfun_ublox_gps-1.1.4.tar.gz
Defaulting to user installation because normal site-packages is not writeable
Processing ./sparkfun_ublox_gps-1.1.4.tar.gz
Preparing metadata (setup.py) ... error
error: subprocess-exited-with-error
× python setup.py egg_info did not run successfully.
│ exit code: 1
╰─> [6 lines of output]
Traceback (most recent call last):
File "<string>", line 2, in <module>
File "<pip-setuptools-caller>", line 34, in <module>
File "/tmp/pip-req-build-2qekh4a4/setup.py", line 40, in <module>
with io.open(path.join(here, "DESCRIPTION.rst"), encoding="utf-8") as f:
FileNotFoundError: [Errno 2] No such file or directory: '/tmp/pip-req-build-2qekh4a4/DESCRIPTION.rst'
[end of output]
note: This error originates from a subprocess, and is likely not a problem with pip.
error: metadata-generation-failed
× Encountered error while generating package metadata.
╰─> See above for output.
note: This is an issue with the package mentioned above, not pip.
hint: See above for details.
pi#raspberrypi:~/Qwiic_Ublox_Gps_Py/dist $ sudo pip3.8 install sparkfun_ublox_gps-1.1.4.tar.gz
Processing ./sparkfun_ublox_gps-1.1.4.tar.gz
Preparing metadata (setup.py) ... error
error: subprocess-exited-with-error
× python setup.py egg_info did not run successfully.
│ exit code: 1
╰─> [6 lines of output]
Traceback (most recent call last):
File "<string>", line 2, in <module>
File "<pip-setuptools-caller>", line 34, in <module>
File "/tmp/pip-req-build-z8m5x52h/setup.py", line 40, in <module>
with io.open(path.join(here, "DESCRIPTION.rst"), encoding="utf-8") as f:
FileNotFoundError: [Errno 2] No such file or directory: '/tmp/pip-req-build-z8m5x52h/DESCRIPTION.rst'
[end of output]
note: This error originates from a subprocess, and is likely not a problem with pip.
error: metadata-generation-failed
× Encountered error while generating package metadata.
╰─> See above for output.
note: This is an issue with the package mentioned above, not pip.
hint: See above for details.
https://github.com/sparkfun/Qwiic_Ublox_Gps_Py/
https://learn.sparkfun.com/tutorials/sparkfun-gps-rtk-dead-reckoning-zed-f9r-hookup-guide
I'm attempting to install PyQt5 through Pip/Pip3 in macOS Monterey. I've updated all Homebrew applications as well as all Pip installations using the recommended process. Every time I attempt to install the PyQt5 module, I recieve numerous errors. I've tried following some guides, and I've tried following related answers on this site. I've tried installing every version of this software from 5.12.0 to CURRENT. Here's the traceback:
% pip3 install PyQt5
Collecting PyQt5
Using cached PyQt5-5.15.6.tar.gz (3.2 MB)
Installing build dependencies ... done
Getting requirements to build wheel ... done
Preparing metadata (pyproject.toml) ... error
error: subprocess-exited-with-error
× Preparing metadata (pyproject.toml) did not run successfully.
│ exit code: 1
╰─> [24 lines of output]
Querying qmake about your Qt installation...
/opt/homebrew/bin/qmake -query
Traceback (most recent call last):
File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/pip/_vendor/pep517/in_process/_in_process.py", line 156, in prepare_metadata_for_build_wheel
hook = backend.prepare_metadata_for_build_wheel
AttributeError: module 'sipbuild.api' has no attribute 'prepare_metadata_for_build_wheel'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/pip/_vendor/pep517/in_process/_in_process.py", line 363, in <module>
main()
File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/pip/_vendor/pep517/in_process/_in_process.py", line 345, in main
json_out['return_val'] = hook(**hook_input['kwargs'])
File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/pip/_vendor/pep517/in_process/_in_process.py", line 160, in prepare_metadata_for_build_wheel
whl_basename = backend.build_wheel(metadata_directory, config_settings)
File "/private/var/folders/5w/d_mjtj250fd4rrrt2g6pq95c0000gn/T/pip-build-env-rgde383o/overlay/lib/python3.9/site-packages/sipbuild/api.py", line 51, in build_wheel
project = AbstractProject.bootstrap('pep517')
File "/private/var/folders/5w/d_mjtj250fd4rrrt2g6pq95c0000gn/T/pip-build-env-rgde383o/overlay/lib/python3.9/site-packages/sipbuild/abstract_project.py", line 83, in bootstrap
project.setup(pyproject, tool, tool_description)
File "/private/var/folders/5w/d_mjtj250fd4rrrt2g6pq95c0000gn/T/pip-build-env-rgde383o/overlay/lib/python3.9/site-packages/sipbuild/project.py", line 610, in setup
self.update(tool)
File "project.py", line 160, in update
sipbuild.exceptions.UserException
[end of output]
note: This error originates from a subprocess, and is likely not a problem with pip.
error: metadata-generation-failed
× Encountered error while generating package metadata.
╰─> See above for output.
note: This is an issue with the package mentioned above, not pip.
hint: See above for details.
Any suggestions? System: macOS Monterey 12.2.1, Apple Silicon M1 (aarch64)
I'm developing with python 3 and trying to install the pyautogui Module, and to be able to use it I had to install some packages. But I keep getting errors when installing the packages with pip3.
Collecting pyobjc-framework-Quartz
Using cached https://files.pythonhosted.org/packages/a9/af/fb7a7264d3bf0147bdd1d01eeb4e8b1cac90f0613aca336b178771dcdec7/pyobjc-framework-Quartz-6.2.tar.gz
Complete output from command python setup.py egg_info:
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "/tmp/pip-install-4ukazwoa/pyobjc-framework-Quartz/setup.py", line 67, in <module>
py_limited_api=True,
File "/tmp/pip-install-4ukazwoa/pyobjc-framework-Quartz/pyobjc_setup.py", line 390, in Extension
os_level = get_os_level()
File "/tmp/pip-install-4ukazwoa/pyobjc-framework-Quartz/pyobjc_setup.py", line 200, in get_os_level
with open("/System/Library/CoreServices/SystemVersion.plist", "rb") as fp:
FileNotFoundError: [Errno 2] No such file or directory: '/System/Library/CoreServices/SystemVersion.plist'
----------------------------------------
Command "python setup.py egg_info" failed with error code 1 in /tmp/pip-install-4ukazwoa /pyobjc-framework-Quartz/
Anyone has a idea what the problem is?
Anything related to Objective C, pyobjc and especially pyobjc-framework-Quartz require Mac OS X. You cannot install them at Ubuntu.
I was trying to install python 3.7 virtualenv packages in my new mac system with runs mac os 10.14.3. But system installation failed due to environment error
Packages:
lxml==3.8.0
Pillow==4.1.1
Fiona==1.7.10.post1
pandas==0.20.2
I Have attached the full crash report in https://pastebin.com/tzMwwHjB
Failed building wheel for Fiona
Failed building wheel for lxml
Failed building wheel for pandas
Failed building wheel for Pillow
Error checking for conflicts.
Traceback (most recent call last):
File "/Users/titus/.virtualenvs/julo-ana/lib/python3.7/site-packages/pip/_vendor/pkg_resources/__init__.py", line 2897, in _dep_map
return self.__dep_map
File "/Users/titus/.virtualenvs/julo-ana/lib/python3.7/site-packages/pip/_vendor/pkg_resources/__init__.py", line 2691, in __getattr__
raise AttributeError(attr)
AttributeError: _DistInfoDistribution__dep_map
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/Users/titus/.virtualenvs/julo-ana/lib/python3.7/site-packages/pip/_vendor/pkg_resources/__init__.py", line 2888, in _parsed_pkg_info
return self._pkg_info
File "/Users/titus/.virtualenvs/julo-ana/lib/python3.7/site-packages/pip/_vendor/pkg_resources/__init__.py", line 2691, in __getattr__
raise AttributeError(attr)
AttributeError: _pkg_info
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/Users/titus/.virtualenvs/julo-ana/lib/python3.7/site-packages/pip/_internal/commands/install.py", line 503, in _warn_about_conflicts
package_set, _dep_info = check_install_conflicts(to_install)
File "/Users/titus/.virtualenvs/julo-ana/lib/python3.7/site-packages/pip/_internal/operations/check.py", line 108, in check_install_conflicts
package_set, _ = create_package_set_from_installed()
File "/Users/titus/.virtualenvs/julo-ana/lib/python3.7/site-packages/pip/_internal/operations/check.py", line 47, in create_package_set_from_installed
package_set[name] = PackageDetails(dist.version, dist.requires())
File "/Users/titus/.virtualenvs/julo-ana/lib/python3.7/site-packages/pip/_vendor/pkg_resources/__init__.py", line 2635, in requires
dm = self._dep_map
File "/Users/titus/.virtualenvs/julo-ana/lib/python3.7/site-packages/pip/_vendor/pkg_resources/__init__.py", line 2899, in _dep_map
self.__dep_map = self._compute_dependencies()
File "/Users/titus/.virtualenvs/julo-ana/lib/python3.7/site-packages/pip/_vendor/pkg_resources/__init__.py", line 2908, in _compute_dependencies
for req in self._parsed_pkg_info.get_all('Requires-Dist') or []:
File "/Users/titus/.virtualenvs/julo-ana/lib/python3.7/site-packages/pip/_vendor/pkg_resources/__init__.py", line 2890, in _parsed_pkg_info
metadata = self.get_metadata(self.PKG_INFO)
File "/Users/titus/.virtualenvs/julo-ana/lib/python3.7/site-packages/pip/_vendor/pkg_resources/__init__.py", line 1410, in get_metadata
value = self._get(self._fn(self.egg_info, name))
File "/Users/titus/.virtualenvs/julo-ana/lib/python3.7/site-packages/pip/_vendor/pkg_resources/__init__.py", line 1522, in _get
with open(path, 'rb') as stream:
FileNotFoundError: [Errno 2] No such file or directory: '/Users/titus/.virtualenvs/julo-ana/lib/python3.7/site-packages/Fiona-1.8.4.dist-info/METADATA'
Could not install packages due to an EnvironmentError: [Errno 2] No such file or directory: '/Users/titus/.virtualenvs/julo-ana/lib/python3.7/site-packages/Fiona-1.8.4.dist-info/RECORD'
Can any one know solution for this. Im trying to fix this for last two days still facing it.
Use the supported version of Python
Try the following:
pip3 install --user package-name (for Python3)
pip install --user package-name (for Python2)
Note: Replace package-name with pandas, lxml, etc
I just downloaded python 3.6 after using python 2 for awhile. I need to download my modules for python 3. I started with downloading pandas (unsuccessfully) and I have tried running in my terminal:
$ sudo pip3 install --user pandas
$ pip3 install --user pandas
$ sudo pip3 install pandas
$ pip3 install pandas
I also ran a few more variations trying to play with it. I receive this error at the end of the output for that last attempt:
Collecting pandas
Using cached pandas-0.19.2.tar.gz
Complete output from command python setup.py egg_info:
Download error on https://pypi.python.org/simple/numpy/: [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed (_ssl.c:749) -- Some packages may not be found!
Couldn't find index page for 'numpy' (maybe misspelled?)
Download error on https://pypi.python.org/simple/: [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed (_ssl.c:749) -- Some packages may not be found!
No local packages or working download links found for numpy>=1.7.0
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "/private/var/folders/68/xjx6zfr570199v_w0dhd9y3c0000gn/T/pip-build-v90_t75r/pandas/setup.py", line 696, in <module>
**setuptools_kwargs)
File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/distutils/core.py", line 108, in setup
_setup_distribution = dist = klass(attrs)
File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/setuptools/dist.py", line 315, in __init__
self.fetch_build_eggs(attrs['setup_requires'])
File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/setuptools/dist.py", line 361, in fetch_build_eggs
replace_conflicting=True,
File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/pkg_resources/__init__.py", line 850, in resolve
dist = best[req.key] = env.best_match(req, ws, installer)
File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/pkg_resources/__init__.py", line 1122, in best_match
return self.obtain(req, installer)
File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/pkg_resources/__init__.py", line 1134, in obtain
return installer(requirement)
File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/setuptools/dist.py", line 429, in fetch_build_egg
return cmd.easy_install(req)
File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/setuptools/command/easy_install.py", line 659, in easy_install
raise DistutilsError(msg)
distutils.errors.DistutilsError: Could not find suitable distribution for Requirement.parse('numpy>=1.7.0')
----------------------------------------
Command "python setup.py egg_info" failed with error code 1 in /private/var/folders/68/xjx6zfr570199v_w0dhd9y3c0000gn/T/pip-build-v90_t75r/pandas/
I am pretty new to python in general so any help would be greatly appreciated. Thank you