I am using Linux Ubuntu 18.04 and python 3. I am trying to build a connection between a maria-db and my python scripts. Therefore I have to install the mariadb package.
I have already installed:
sudo apt install mariadb-server
But when i try:
pip install mariadb
I get following error:
Collecting mariadb
Using cached mariadb-1.0.0.tar.gz (78 kB)
ERROR: Command errored out with exit status 1:
command: /home/niklas/Desktop/Stuff/venv/bin/python -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pycharm-packaging/mariadb/setup.py'"'"'; __file__='"'"'/tmp/pycharm-packaging/mariadb/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' egg_info --egg-base /tmp/pip-pip-egg-info-wfnscxnz
cwd: /tmp/pycharm-packaging/mariadb/
Complete output (12 lines):
/bin/sh: 1: mariadb_config: not found
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "/tmp/pycharm-packaging/mariadb/setup.py", line 26, in <module>
cfg = get_config(options)
File "/tmp/pycharm-packaging/mariadb/mariadb_posix.py", line 49, in get_config
cc_version = mariadb_config(config_prg, "cc_version")
File "/tmp/pycharm-packaging/mariadb/mariadb_posix.py", line 27, in mariadb_config
"mariadb_config not found.\nPlease make sure, that MariaDB Connector/C is installed on your system, edit the configuration file 'site.cfg' and set the 'mariadb_config'\noption, which should point to the mariadb_config utility.")
OSError: mariadb_config not found.
Please make sure, that MariaDB Connector/C is installed on your system, edit the configuration file 'site.cfg' and set the 'mariadb_config'
option, which should point to the mariadb_config utility.
----------------------------------------
ERROR: Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output.
Can anybody help me ?
Edit:
I have now been able to connect to the server but not with te mariadb package. (https://linuxhint.com/connect_mariadb_pymysql/)
Install MariaDB Connector/C, which is a dependency.
sudo apt-get install libmariadb3 libmariadb-dev
Use PIP to install MariaDB Connector/Python.
pip3 install mariadb
To install mariadb python module, you have to install a recent version of MariaDB Connector/C, minimum required version is 3.1.5, afaik Ubuntu 18.04 has 3.0.3.
An actual version of Connector/C for bionic is available on the MariaDB Connector/C Download Page.
If you want to install it in a special directory, make sure that the PATH and LD_LIBRARY_PATH point to bin and lib directories.
I also recommend to use a recent version of MariaDB Server, especially the very fast executemany() method will be much slower on MariaDB Server < 10.2.
It seems you need to install it first on your OS.
You can follow this guide to install it properly.
Related
$ cd surface_dynamics
$ pip3 install .
Processing /Users/jacobelection/surface_dynamics
ERROR: Command errored out with exit status 1:
command: /usr/local/Caskroom/miniconda/base/bin/python -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/private/var/folders/m8/lmzlkfq11wj3rn17q7xm7g2m0000gn/T/pip-req-build-ubkp2yci/setup.py'"'"'; __file__='"'"'/private/var/folders/m8/lmzlkfq11wj3rn17q7xm7g2m0000gn/T/pip-req-build-ubkp2yci/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' egg_info --egg-base /private/var/folders/m8/lmzlkfq11wj3rn17q7xm7g2m0000gn/T/pip-pip-egg-info-jhapggrl
cwd: /private/var/folders/m8/lmzlkfq11wj3rn17q7xm7g2m0000gn/T/pip-req-build-ubkp2yci/
Complete output (15 lines):
Traceback (most recent call last):
File "/private/var/folders/m8/lmzlkfq11wj3rn17q7xm7g2m0000gn/T/pip-req-build-ubkp2yci/setup.py", line 9, in <module>
import sage.all
ModuleNotFoundError: No module named 'sage'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "/private/var/folders/m8/lmzlkfq11wj3rn17q7xm7g2m0000gn/T/pip-req-build-ubkp2yci/setup.py", line 11, in <module>
raise ValueError("this package currently installs only inside SageMath (http://www.sagemath.org)\n"
ValueError: this package currently installs only inside SageMath (http://www.sagemath.org)
If you are using Ubuntu with Sage installed from the official apt repository, run
first in a console "$ source /usr/share/sagemath/bin/sage-env"
----------------------------------------
WARNING: Discarding file:///Users/jacobelection/surface_dynamics. Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output.
ERROR: Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output.
How could I fixed these problem? My python version is 3.8.3. macOS Big Sur 11.1
The command needs to be run with the pip that
corresponds to SageMath's Python, which would
depend on the way SageMath was installed:
built from source?
from binaries from the SageMath download page?
from Marc Culler's SageMath app?
via Homebrew cask?
via Conda?
One way to go is to install the SageMath macOS app from
https://github.com/3-manifolds/Sage_macOS/releases
and run the Recommended.pkg installer.
Then instead of
pip3 install .
run
sage --pip install .
Or if you installed SageMath via Conda, make sure to
first activate the corresponding Conda environment:
conda activate sage
pip install .
In case of doubt, check what pip is going to be called
with commands such as:
which pip
ls -halF $(which pip)
which pip3
ls -halF $(which pip3)
I'm trying to install gwsurrogate package and it need Numpy, so I tried to install it using pip and it said it was installed successfully. However I keep getting this error that "Polyfit is poorly conditioned":
>>> % pip3 install gwsurrogate
Collecting gwsurrogate
Using cached gwsurrogate-1.0.6.tar.gz (5.2 MB)
ERROR: Command errored out with exit status 1:
command: /Library/Frameworks/Python.framework/Versions/3.9/bin/python3.9 -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/private/var/folders/xc/4hwyd4314gx75b9tqmy4l7qc0000gn/T/pip-install-0_og_kv1/gwsurrogate/setup.py'"'"'; __file__='"'"'/private/var/folders/xc/4hwyd4314gx75b9tqmy4l7qc0000gn/T/pip-install-0_og_kv1/gwsurrogate/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' egg_info --egg-base /private/var/folders/xc/4hwyd4314gx75b9tqmy4l7qc0000gn/T/pip-pip-egg-info-xbzt899i
cwd: /private/var/folders/xc/4hwyd4314gx75b9tqmy4l7qc0000gn/T/pip-install-0_og_kv1/gwsurrogate/
Complete output (10 lines):
init_dgelsd failed init
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "/private/var/folders/xc/4hwyd4314gx75b9tqmy4l7qc0000gn/T/pip-install-0_og_kv1/gwsurrogate/setup.py", line 39, in <module>
import numpy
File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/numpy/__init__.py", line 286, in <module>
raise RuntimeError(msg)
RuntimeError: Polyfit sanity test emitted a warning, most likely due to using a buggy Accelerate backend. If you compiled yourself, see site.cfg.example for information. Otherwise report this to the vendor that provided NumPy.
RankWarning: Polyfit may be poorly conditioned
----------------------------------------
ERROR: Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output.
I tried to uninstall and reinstall Numpy but nothing changed.
Faced this on MacOS 11.1 (Python 3.9.1) while installing numpy as camelot/excalibur dependency. Got it fixed by first upgrading pip latest version:
python3 -m pip install --upgrade pip --user
Found the answer from here: macOS Big Sur python3 cannot import numpy due to polyfit error
If this does not help, you might want to describe what OS version you are on for getting more environment specific help.
well, i use windows and with PIP set up, you can use its command line for installing NumPY.
To install NumPy with the package manager for Python 3, run the following command:
pip install numpy
Pip downloads the NumPy package and notifies you it has been successfully installed.
To upgrade Pip on windows, enter the following in command prompt:
python -m pip install --upgrade pip
This command first uninstalls the old version of Pip and then installs the most current version of Pip.
After the installation, you can use the show command to verify whether NumPy is now part of your Python packages. Run the following command:
pip3 show numpy
the output should confirm you have Numpy, which version you are using, as well as where the package is stored.
this should get your NumPy installed on windows. if you want a more step by step breakdown on how to go about this, you can find that here
https://www.thewindowsclub.com/how-to-install-numpy-using-pip-on-windows-10
I am trying to install this module from github.
https://github.com/ChristianSchneeweiss/Chat-txt-to-csv
First, I am following the steps listed here.
https://medium.com/i-want-to-be-the-very-best/installing-packages-from-github-with-conda-commands-ebf10de396f4
so I used this line in Anaconda Powershell Prompt
pip install git+git://github.com/ChristianSchneeweiss/Chat-txt-to-csv.git
it didn't work. and then I used this code, based on the suggestions here.
Use package from Github in Conda Virtual Environment
pip install C:\Users\Lulz\Documents\mamanitip\chat_wa\Chat-txt-to-csv-master.zip
it didn't work either. both codes resulted in this error.
command: 'C:\ProgramData\Anaconda3\python.exe' -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\Lulz\\AppData\\Local\\Temp\\pip-req-build-2cr6dd41\\setup.py'"'"'; __file__='"'"'C:\\Users\\Lulz\\AppData\\Local\\Temp\\pip-req-build-2cr6dd41\\setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' egg_info --egg-base 'C:\Users\Lulz\AppData\Local\Temp\pip-pip-egg-info-3o0zsjkm'
cwd: C:\Users\Lulz\AppData\Local\Temp\pip-req-build-2cr6dd41\
Complete output (5 lines):
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "C:\ProgramData\Anaconda3\lib\tokenize.py", line 447, in open
buffer = _builtin_open(filename, 'rb')
FileNotFoundError: [Errno 2] No such file or directory: 'C:\\Users\\Lulz\\AppData\\Local\\Temp\\pip-req-build-2cr6dd41\\setup.py'
----------------------------------------
ERROR: Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output.
i've tried creating new Microsoft accounts, and installing in a new environment, but it still didn't work. it always resulted in the same error, just different users (as I change Microsoft accounts). what did I do wrong? thank you so much for your help.
The package at https://github.com/ChristianSchneeweiss/Chat-txt-to-csv cannot be installed with pip because it does not have the file setup.py. What you can do instead is to download the project onto your computer, install the project's dependencies, and then use the project from its directory. If you run python from within that project's directory, it will find the package.
git clone https://github.com/ChristianSchneeweiss/Chat-txt-to-csv
cd Chat-txt-to-csv
python -m pip install --no-cache-dir -r requirements.txt
python convert.py chat.txt
I am not quite experienced using pip. When I tried to install some packages, I had this error and had no idea what that meant. This happened to multiple packages that I tried to install. Any suggestions would be appreciated.
sudo pip install mysql-python
Password:
WARNING: The directory '/Users/yzr/Library/Caches/pip' or its parent directory is not owned or is not writable by the current user. The cache has been disabled. Check the permissions and owner of that directory. If executing pip with sudo, you may want sudo's -H flag.
Collecting mysql-python
Downloading MySQL-python-1.2.5.zip (108 kB)
|████████████████████████████████| 108 kB 2.2 MB/s
ERROR: Command errored out with exit status 1:
command: /Users/yzr/opt/anaconda3/bin/python -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/private/tmp/pip-install-0kcqh5vw/mysql-python/setup.py'"'"'; __file__='"'"'/private/tmp/pip-install-0kcqh5vw/mysql-python/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' egg_info --egg-base /private/tmp/pip-install-0kcqh5vw/mysql-python/pip-egg-info
cwd: /private/tmp/pip-install-0kcqh5vw/mysql-python/
Complete output (7 lines):
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "/private/tmp/pip-install-0kcqh5vw/mysql-python/setup.py", line 13, in <module>
from setup_posix import get_config
File "/private/tmp/pip-install-0kcqh5vw/mysql-python/setup_posix.py", line 2, in <module>
from ConfigParser import SafeConfigParser
ModuleNotFoundError: No module named 'ConfigParser'
----------------------------------------
ERROR: Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output.
I’m assuming you are using an Unix system such as Linux or MacOS.
Maybe you are accidentally using the python2.7 version installed on your system.
You can use a specific version of python for pip with:
python3 -m pip install mysql-python
Let me explain myself, every MacOS or Linux system has two Python versions (2.7 and 3.x) by default, and both of those versions has a pip module related to it, in other words, you have a pip module for Python 2.7 and other pip module for Python 3.x.
However, I’m assuming you are using python3 for your project, therefore, you must specify the pip module to use.
Other way to avoid this problem is using a virtual environment manager, such as pipenv or built in virtualenv module.
It looks like your pip package doesn't have the module "ConfigParser" installed. You should be able to install it by running:
pip install ConfigParser
Alternatively, depending on your Python version, try installing mysqlclient instead:
pip install mysqlclient
I tried installing pygame using
pip install pygame
I tried installing it using Python 3.8 but it outputs the error below.
I also tried installing using Python 3.7 but still no luck.
The error:
ERROR: Command errored out with exit status 1:
command: 'c:\users\asus\appdata\local\programs\python\python38-32\python.exe'
-c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\Asus\\AppData\\Local\\Temp\\pip-install-_ptqagog\\pygame\\setup.py'"'"';
__file__='"'"'C:\\Users\\Asus\\AppData\\Local\\Temp\\pip-install-_ptqagog\\pygame\\setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' egg_info --egg-base 'C:\Users\Asus\AppData\Local\Temp\pip-install-_ptqagog\pygame\pip-egg-info'
cwd: C:\Users\Asus\AppData\Local\Temp\pip-install-_ptqagog\pygame\
Complete output (17 lines):
WARNING, No "Setup" File Exists, Running "buildconfig/config.py"
Using WINDOWS configuration...
Download prebuilts to "prebuilt_downloads" and copy to "./prebuilt-x86"? [Y/n]Traceback (most recent call last):
File "<string>", line 1, in <module>
File "C:\Users\Asus\AppData\Local\Temp\pip-install-_ptqagog\pygame\setup.py", line 194, in <module>
buildconfig.config.main(AUTO_CONFIG)
File "C:\Users\Asus\AppData\Local\Temp\pip-install-_ptqagog\pygame\buildconfig\config.py", line 210, in main
deps = CFG.main(**kwds)
File "C:\Users\Asus\AppData\Local\Temp\pip-install-_ptqagog\pygame\buildconfig\config_win.py", line 576, in main
and download_win_prebuilt.ask(**download_kwargs):
File "C:\Users\Asus\AppData\Local\Temp\pip-install-_ptqagog\pygame\buildconfig\download_win_prebuilt.py", line 302, in ask
reply = raw_input(
EOFError: EOF when reading a line
----------------------------------------
ERROR: Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output.
Use this (I was facing the same issue and it helped me out):
pip install pygame --pre
You can try to install from the Wheel file.
After verifying that you're using python 3.7
python --version # Python 3.7.X
pip install pygame-1.9.6-cp37-cp37m-win_amd64.whl
What kind of OS system are you using? I have no problem to install on python 3.7
(base) $ python3 -m pip install -U pygame --user
Collecting pygame
Downloading https://files.pythonhosted.org/packages/32/37/453bbb62f90feff2a2b75fc739b674319f5f6a8789d5d21c6d2d7d42face/pygame-1.9.6-cp37-cp37m-macosx_10_11_intel.whl (4.9MB)
|████████████████████████████████| 4.9MB 2.7MB/s
Installing collected packages: pygame
Successfully installed pygame-1.9.6
(base) $ python -m pygame.examples.aliens
pygame 1.9.6
Hello from the pygame community. https://www.pygame.org/contribute.html
If the problem persists, you should use conda or another environment manager to create new environment and then install the library.
I'm not getting an error when I do this. Have you tried:
pip install pygame
Have you attempted installing with command-prompt or terminal? When I run what you are doing, I don't seem to get a problem.
Additionally, pygame is not compatible with 3.8 yet as it is unstable. Maybe wait a few months until modules are ready to be used with 3.8. Hope this helps, good day.