Django on Mac with mysql - python

I’m new in Django on Mac. I faced a problem in configuring Django environment with mysql on Mac.
The error is “
django.core.exceptions.ImproperlyConfigured: Error loading MySQLdb module: dlopen(/Users/david/david-env/lib/python2.7/site-packages/_mysql.so, 2): Symbol not found: _mysql_shutdown
Referenced from: /Users/david/david-env/lib/python2.7/site-packages/_mysql.so
Expected in: flat namespace
in /Users/david/david-env/lib/python2.7/site-packages/_mysql.so
”
I have referred serval related answers and methods from stackoverflow, such as
pip uninstall MySQL-python
brew uninstall mysql
brew install mysql --universal
pip install MySQL-python
Unfortunately, it doesn’t work.
I have built my virtualenv of python2.7.10 on Mac. I have used “pip install ” command to install serval packages including “Django-1.10.6”, “MySQL-python-1.2.5” and “mysqlclient”.
I have installed “MySQL Server 5.7.17”, “MySQL Workbench” and “XCode”. Everything looks good , but the error can not be fixed.
I also tried to use different versions of “MySQL-python” package, including “1.2.5” and “1.2.3” (I failed to install version 1.2.4). Failed either.
I hope there is someone could help give a hand and lead me out of the trouble which destroyed my weekend. Thank you very much.

Downgrade your MySQL to 5.5 or below.
Refer to the MySQL-python 1.2.5 intro page:
MySQL-3.23 through 5.5 and Python-2.4 through 2.7 are currently
supported. Python-3.0 will be supported in a future release. PyPy is
supported.

Related

GLIBC_2.33 not found in raspberry pi python

Error Trace:
ImportError: /lib/arm-linux-gnueabihf/libc.so.6: version `GLIBC_2.33' not found (required by /home/pi/.local/lib/python3.7/site-packages/grpc/_cython/cygrpc.cpython-37m-arm-linux-gnueabihf.so)
Scenario:
I'm using google cloud vision api to detect text in images. The program works fine on laptop but gives the above mentioned error when ran in raspberry pi. I've searched a lot but couldn't find any working solution. I'd really appreciate if any one could let me know how to solve this.
Uninstalling grpcio and grpcio-status (mine had version 1.46.3 installed for both) and installing version 1.44.0 solved it for me:
pip uninstall grpcio
pip uninstall grpcio-status
pip install grpcio==1.44.0 --no-binary=grpcio
pip install grpcio-tools==1.44.0 --no-binary=grpcio-tools
You can check your installed versions with pip list.
Note: installing grpcio and grpcio-status takes a really long time. About 15 to 20 minutes each.
Originally posted here: https://groups.google.com/g/grpc-io/c/vjbL3IdZ2Vk/m/EcKSeD4eAgAJ
GLIBC and the kernel of the OS go hand-in-hand; you basically need a newer version of your OS, if you need a more recent GLIBC
the version of the GLIBC can be quickly found out with the following command:
ldd --version
Have you tried building glibc 2.33+ alongside the glibc that come in raspberry pi? Something along this answer and comments to use buildroot

Error while running azuremlsdk::install_azureml() in R

I'm trying to load an existing azure workspace in RStudio Azure Compute Instance like it's shown in this link: https://azure.github.io/azureml-sdk-for-r/. But, after installing azuremlsdk package when I'm running this code azuremlsdk::install_azureml(). I'm getting this error :
Attempting uninstall: certifi  Found existing installation: certifi2016.9.26ERROR: Cannot uninstall 'certifi'. It is a distutilsinstalled project and thus we cannot accurately determine which files belong to it which would lead to only a partial uninstall.Error: Error installing package(s): 'azureml-sdk==1.10.0', 'numpy', 'pandas'
By referring to this link : https://learn.microsoft.com/en-us/azure/machine-learning/how-to-troubleshoot-environments; I tried to fix this error by running conda remove certifi through terminal of that Compute Instance & Jupyter Notebook of that Compute Instance. But, no luck.
Does anyone have any experience in resolving this issue. Please help.
Azure ML has issues with Python versions and its dependency packages, make sure you are using Python package of 3.5 to 3.8 while installing these.
While installing azureml it will search for all the dependency packages and will install all of them, in this process there will be the version issues, like pandas, numpy.. with different pip versions.
From your stack trace looks like the error is happening when we install the packages like pandas numpy etc along with azureml-train-automl-client package so try to install them before hand by checking its versions which are dependent with you python versions packages.
Check the Azure ML documentation for installation of Azure ML Additional packages.
If you investigate them azureml-train-automl requires somes data science packages including pandas, numpy, and scikit-learn.
Kindly follow below commands for conda environment:
pip install azureml-train-automl
pip install --upgrade azureml-train-automl
pip install show azureml-train-automl
It seems that the Python SDK installation conflicts with itself when using Python 3.6 (the default). I was able to install the SDK for Python 3.7:
azuremlsdk::install_azureml(conda_python_version = '3.7')

Can't find Brew installed packages on Mac M1 in Pycharm

I'm having trouble installing packages and using them in Pycharm. I've followed various threads (I'm new to Macs and seem to have tried everything) now I'm stuck.
In this case, I want to use the package xgboost.
I have brew installed, after launching a terminal using Rosetta:
%brew install xgboost
Warning: xgboost 1.3.3 is already installed and up-to-date.
It appears installed OK here:
/opt/homebrew/Cellar/xgboost
I also have Python installed here:
/opt/homebrew/Cellar/python#3.9
But no matter how I configure an Interpreter in Pycharm, I can't seem to get the package recognised.
Where have I gone wrong?
I am very unsure exactly how, but I've got this working.
Following: https://abbasegbeyemi.me/blog/homebrew-python-apple-m1
I changed the order of elements in my path:
export PATH=/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/opt/homebrew/bin
then a new interpreter in Pycharm using:
usr/local/Cellar/Python#3.9/3.9.2_2/bin/python3.9
Now I can install packages just using pip in pycharm and it works.
This has been 6 hours of pain - warning to anyone who isn't well versed in macs, setting up an M1 for python dev was a complete nightmare for me.
Docs: https://xgboost.readthedocs.io/en/latest/build.html
Pre-built binary wheel for Python
If you are planning to use Python, consider installing XGBoost from a pre-built binary wheel, available from Python Package Index (PyPI). You may download and install it by running
# Ensure that you are downloading one of the following:
# * xgboost-{version}-py2.py3-none-manylinux1_x86_64.whl
# * xgboost-{version}-py2.py3-none-win_amd64.whl
pip3 install xgboost

Cython_VST_loader not installing through PIP

I am using anaconda3 with Python Version 3.8.
I followed the installation instructions for Cython VST loader per the package’s website (https://pypi.org/project/cython-vst-loader/).
This entailed:
Updating Anaconda compiler (from https://anaconda.org/conda-forge/compilers , 2nd line of code worked)
PIP installing ‘make’ via Anaconda command line
Not sure how to install/update headers, this may or may not be causing the error.
When I attempt to pip install cython_vst_loader in the command line, I receive the following deluge of errors.
Any help or resources on how to address this problem would be greatly appreciated, thank you!
With the new 0.3.6 version of the loader (released 15 minutes ago), Windows is supported and binaries are provided. Also, project goals are clarified in Readme, you might want to check them as well https://github.com/hq9000/cython-vst-loader/blob/master/README.md
You can install the new version normally with pip.

pip msgpack error while installing requirements

I used pip install -r requirements.txt, and got this error:
AttributeError: module 'msgpack' has no attribute 'dumps'
Full log: https://pastebin.com/aTTwyrML
requirements.txt: https://github.com/poljar/weechat-matrix/blob/master/requirements.txt
This also seems to break other uses of pip install.
I can't find any pip issues or solutions to this anywhere.
EDIT: msgpack is being inmported from: '/usr/lib/python3.8/site-packages/msgpack/__init__.py'
Other packages that cause the error:
pytconf
You're running python version 3.8 and msgpack only supports up to 3.7. This might be causing a problem installing msgpack via pip or there's some breaking implementation in 3.8 that's not in 3.7 and under. I know I've run into some trouble with sharing projects between teams that are using 3.8 and teams that are using earlier verions.
msgpack on pypi.

Categories