openssl Library not found - python

I've looked through dozens of posts about this and nothing seems to work so I think I'm just missing something but I'm doing a beginners tutorial on making a website using python so I'm not totally sure what I'm doing wrong. I did
brew install mysql
and at the end of the install process I saw this: (I don't know if something was wrong at this point)
/usr/bin/install_name_tool: object: /usr/local/Cellar/mysql/5.6.20_1/lib/libmysqlclient.18.dylib malformed object (unknown load command 9)
/usr/bin/install_name_tool: object: /usr/local/Cellar/mysql/5.6.20_1/lib/libmysqlclient.18.dylib malformed object (unknown load command 9)
==> /usr/local/Cellar/mysql/5.6.20_1/bin/mysql_install_db --verbose --user=giancosta --basedir=/usr/local/Cellar/mysql/5.6.20_1 --datadir=/usr/local/var/
/usr/local/Cellar/mysql/5.6.20_1/bin/resolveip
Please configure the 'hostname' command to return a correct
hostname.
If you want to solve this at a later stage, restart this script
with the --force option
Warning: The post-install step did not complete successfully
You can try again using `brew postinstall mysql`
==> Summary
🍺 /usr/local/Cellar/mysql/5.6.20_1: 9579 files, 342M
Then I did
sudo easy_install mysql-python
which ended with: (again, I don't know if something was wrong at this point)
20 warnings generated.
ld: warning: ignoring file /usr/local/Cellar/mysql/5.6.20_1/lib/libmysqlclient_r.dylib, file was built for unsupported file format which is not the architecture being linked (i386)
zip_safe flag not set; analyzing archive contents...
Adding MySQL-python 1.2.5 to easy-install.pth file
Installed /Library/Python/2.7/site-packages/MySQL_python-1.2.5-py2.7-macosx-10.8-intel.egg
Processing dependencies for mysql-python
Finished processing dependencies for mysql-python
Finally I ran:
mysqld
But I get:
dyld: Library not loaded: ##HOMEBREW_PREFIX##/opt/openssl/lib/libssl.1.0.0.dylib
Referenced from: /usr/local/bin/mysqld
Reason: image not found
Trace/BPT trap: 5
So looking at other posts I tried removing or uninstalling openssl and then reinstalling it. But that's not working. I don't know what to do at this point. I've even tried uninstalling mysql to start over using
sudo uninstall mysql
But that just gives me:
Preparing Uninstall...
Uninstall Began...
Uninstall Failed...
Reason: ErrorMissingBundle
I'm a beginner so I really don't know what to do/what's wrong at this point. Do I need to start over? If so, how? I've read posts that talk about links and OpenSSL messing things up, etc. but this is pretty foreign to me at this point. Any help would be greatly appreciated.

You should try using pip (A tool for installing and managing Python packages) to install it.
pip install MySQL-python

Related

Unable to install PyMuPDF with MuPDF - python on Mac 10.13.4

Morning
To start out, let me just say I'm a python novice - so I hope this question isn't going to be stupid.
I'm running Mac 10.13.4 (Beta) and am trying to get PyMuPDF working.
As per https://github.com/rk700/PyMuPDF/:
I've downloaded both PyMuPDf and MuPDF.
I ran brew install mupdf-tools
I ran export ARCHFLAGS='-arch x86_64'
At this point I am not sure whether I need to build MuPDF by running
make prefix=/usr/local install
(as per https://mupdf.com/docs/building.html) or go straight to
python setup.py install
If I try build mupdf using make, then I get the following error:
include/mupdf/fitz/config.h:92:1: error: expected identifier or '('
... ... ...
^
In file included from source/fitz/archive.c:1:
In file included from include/mupdf/fitz.h:35:
include/mupdf/fitz/pixmap.h:360:2: error: unknown type name 'ptrdiff_t'
ptrdiff_t stride;
If I run the setup.py install, then I get errors when trying to import Fitz. I know that there is an instruction saying that the include_dirs and library_dirs should be updated, but the directories they refer to do not appear to be there (other that in the source files I downloaded).
I appreciate that this is all down to me being a python rookie - any pointers would be greatly appreciated.

python installing thread-local storage

I'm trying to install a pysnap library from github. This is part of the output I get. I have no idea how to proceed, any help would be greatly appreciated.
Installed /Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/pysnap-0.1.1-py2.7.egg
Processing dependencies for pysnap==0.1.1
Searching for cryptography>=1.2.2
Reading https://pypi.python.org/simple/cryptography/
Best match: cryptography 1.2.3
Downloading https://pypi.python.org/packages/source/c/cryptography/cryptography-1.2.3.tar.gz#md5=5474d2b3e8c7555a60852e48d2743f85
Processing cryptography-1.2.3.tar.gz
Writing /tmp/easy_install-7ZnmT5/cryptography-1.2.3/setup.cfg
Running cryptography-1.2.3/setup.py -q bdist_egg --dist-dir /tmp/easy_install-7ZnmT5/cryptography-1.2.3/egg-dist-tmp-rcoXcx
_configtest.c:1:1: error: thread-local storage is unsupported for the current target
__thread int some_threadlocal_variable_42;
1 error generated.
error: unable to create target: 'No available targets are compatible with this triple, see -version for the
available targets.'
1 error generated.
What platform are you trying to install pysnap?
I downloaded and installed pysnap sucessfully from this github location
I do have windows 10 platform and python 2.7 though. I dont' have a linux to replicate this issue.
If you are trying to install on Linux, depending on flavor and its setup , sometimes swap is setup as as /tmp and some applications are not able to write to /tmp. In your case it does looks like its trying to write to /tmp and erroring out.
Can you try pip install cryptography
and see if its able to install cryptography part without issues?
Once that dependency is out of way, you can install pysnap so that pysnap will not try to install cryptography

Setup script exited with error: Unable to find vcvarsall.bat

I got the folloiwng error while running my script
Traceback (most recent call last):
File "mysql.py", line 2, in <module>
import MySQLdb
ImportError: No module named MySQLdb
Tried to install mysql-python as suggested in No module named MySQLdb but running
into following error ,can anyone suggest how to overcome this error?
C:\Dropbox\scripts>easy_install mysql-python
Searching for mysql-python
Reading http://pypi.python.org/simple/mysql-python/
Best match: MySQL-python 1.2.5
Downloading https://pypi.python.org/packages/source/M/MySQL-python/MySQL-python-1.2.5.zip#md5=654f75b302db6ed8dc5a898c625e030c
Processing MySQL-python-1.2.5.zip
Running MySQL-python-1.2.5\setup.py -q bdist_egg --dist-dir c:\users\gnakkala\appdata\local\temp\easy_install-kowc5r\MySQL-python-1.2.5\egg-dist-tmp-1gslvq
error: Setup script exited with error: Unable to find vcvarsall.bat
I had a similar issue with getting MySQL-python to install properly and work for me. I tried both easy_install and pip, both had issues with vcvarsall.bat. Below is what I did to solve my problem, which I think might be able to lead you in the right direction. I have a Windows 8 Machine, Python 2.7 installed and running my stuff through eclipse.
Some Background:
When I did an easy install it tries to install MySQL-python 1.2.5 which failed with an error: Unable to find vcvarsall.bat. I did an easy_install of pip and tried the pip install which also failed with a similar error. They both reference vcvarsall.bat which is something to do with visual studio, since I don't have visual studio on my machine, it left me looking for a different solution, which I share below.
The Solution:
Reinstall python 2.7.8 from 2.7.8 from https://www.python.org/download this will add any missing registry settings, which is required by the next install.
Install 1.2.4 from http://pypi.python.org/pypi/MySQL-python/1.2.4
After I did both of those installs I was able to query my MySQL db through eclipse.
1 install wheel
pip install wheel
2 Download .whl file from http://www.lfd.uci.edu/~gohlke/pythonlibs/#lxml
Ctrl+F, search mysql . you can find :
MySQL-python, a Python database API 2.0 interface for the MySQL database
Mysqlclient is a Python 3 compatible fork of MySQL-python.
MySQL_python-1.2.5-cp27-none-win32.whl
MySQL_python-1.2.5-cp27-none-win_amd64.whl
Mysqlclient, a fork of the MySQL-python interface for the MySQL database.
mysqlclient-1.3.8-cp27-cp27m-win32.whl
mysqlclient-1.3.8-cp27-cp27m-win_amd64.whl
mysqlclient-1.3.8-cp34-cp34m-win32.whl
mysqlclient-1.3.8-cp34-cp34m-win_amd64.whl
mysqlclient-1.3.8-cp35-cp35m-win32.whl
mysqlclient-1.3.8-cp35-cp35m-win_amd64.whl
mysqlclient-1.3.8-cp36-cp36m-win32.whl
mysqlclient-1.3.8-cp36-cp36m-win_amd64.whl

Problems with python easy install

I have a problem using easy_install for matplotlib-venn. I'm on a windows computer using python2.7.
I'm suspecting the path is not correct but I do not know how to fix the problem.
Could anyone help me?
I'm attaching the output from trying to run the easy_install command in the CMD prompter.
C:\Python27\Scripts>easy_install matplotlib-venn
Searching for matplotlib-venn
Reading https://pypi.python.org/simple/matplotlib-venn/
Download error on https://pypi.python.org/simple/matplotlib-venn/: [Errno 11004]
getaddrinfo failed -- Some packages may not be found!
Couldn't find index page for 'matplotlib-venn' (maybe misspelled?)
Scanning index of all packages (this may take a while)
Reading https://pypi.python.org/simple/
Download error on https://pypi.python.org/simple/: [Errno 11004] getaddrinfo fai
led -- Some packages may not be found!
No local packages or download links found for matplotlib-venn
error: Could not find suitable distribution for Requirement.parse('matplotlib-ve
nn')
install for matplotlib-venn package
Output from trying the pip install suggestion:
C:\Python27\Scripts>easy_install pip
Searching for pip
Best match: pip 1.4.1
Adding pip 1.4.1 to easy-install.pth file
Installing pip-script.py script to C:\Python27\Scripts
Installing pip.exe script to C:\Python27\Scripts
Installing pip.exe.manifest script to C:\Python27\Scripts
Installing pip-2.7-script.py script to C:\Python27\Scripts
Installing pip-2.7.exe script to C:\Python27\Scripts
Installing pip-2.7.exe.manifest script to C:\Python27\Scripts
Using c:\python27\lib\site-packages
Processing dependencies for pip
Finished processing dependencies for pip
C:\Python27\Scripts>pip install matplotlib-venn
Downloading/unpacking matplotlib-venn
Cannot fetch index base URL https://pypi.python.org/simple/
Could not find any downloads that satisfy the requirement matplotlib-venn
Cleaning up...
No distributions at all found for matplotlib-venn
Storing complete log in C:\Users\jherman8\pip\pip.log
Based on
Download error on https://pypi.python.org/simple/matplotlib-venn/: [Errno 11004] getaddrinfo failed
and
Cannot fetch index base URL https://pypi.python.org/simple/
it seems that your have network issue. Do you run your machine behind a firewall or a proxy?
For easy_install to work behind proxy, you have to setup needed environments, for example
set http_proxy="user:password#server:port"
set https_proxy="user:password#server:port"
For pip you can use -proxy argument. More details on pip usage behind proxy see in this thread: How to use pip on windows behind an authenticating proxy
I think this is your solution
easy_install pip
pip install matplotlib-venn
No module matplotlib-venn in easy_install
And for future, use pip for install any package for python.
student#student-WIV68105-0080:~$ **sudo apt-cache search rtree**
libcneartree-dev - Library and headers for solving the Nearest Neighbor Problem
libcneartree5 - Library for solving the Nearest Neighbor Problem
student#student-WIV68105-0080:~$ **sudo apt-get install libcneartree-dev libcneartree5**
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following extra packages will be installed:
libcvector2
The following NEW packages will be installed:
libcneartree-dev libcneartree5 libcvector2
For me the same error occurred for rtree package and I did the cache search and installed the liraries
In-case of cloudera box if you are trying then this will work as reaised in bugzile.
https://bugzilla.redhat.com/show_bug.cgi?id=1510444
It works for my cloudera vm jut follow the insteruction and then try to isntall by easy_install.
# easy_install -i https://pypi.python.org/simple stitches Searching for stitches Reading https://pypi.python.org/simple/stitches/ Best match: stitches 0.11 Downloading https://pypi.python.org/packages/9d/73/681005f0f0fb9483f0d94547a35059c776144fc998780b9ef00167a50f3d/stitches-0.11.tar.gz#md5=0ac0b6e418767e6ec5cf684460d1972f Processing stitches-0.11.tar.gz Running stitches-0.11/setup.py -q bdist_egg --dist-dir /tmp/easy_install-ZMIU8w/stitches-0.11/egg-dist-tmp-82ctsZ zip_safe flag not set; analyzing archive contents... stitches.connection: module references file Adding stitches 0.11 to easy-install.pth file
Installed /usr/lib/python2.6/site-packages/stitches-0.11-py2.6.egg Processing dependencies for stitches ... ... Searching for pynacl>=1.0.1 Reading https://pypi.python.org/simple/pynacl/ Best match: PyNaCl 1.2.0 Downloading https://pypi.python.org/packages/fa/38/0f35ec4beb6562f1abfa07914db1cea978e93da409ba6293f810d9e677d6/PyNaCl-1.2.0.tar.gz#md5=7a31e95f5f457184b1660b71d6808b19 Processing PyNaCl-1.2.0.tar.gz Running PyNaCl-1.2.0/setup.py -q bdist_egg --dist-dir /tmp/easy_install-a0vNJS/PyNaCl-1.2.0/egg-dist-tmp-QYvAk9 Checking .pth file support in . /usr/bin/python -E -c pass Searching for cffi>=1.4.1 Reading http://pypi.python.org/simple/cffi/ Couldn't find index page for 'cffi' (maybe misspelled?) Scanning index of all packages (this may take a while) Reading http://pypi.python.org/simple/ No local packages or download links found for cffi>=1.4.1 error: Could not find suitable distribution for Requirement.parse('cffi>=1.4.1')
So the only solution is hacking the source code:
sed -i s,http://pypi.python.org,https://pypi.python.org, /usr/lib/python2.6/site-packages/setuptools/command/easy_install.py
sudo

Installing Django: Using XAMPP's MySQL, MySQL-python 1.2.3 & 1.2.4 errors?

I am following this awesome walk-through on how to install python.
I don't think I have a real problem as ...I think I'm able to work on my django project... however I ran into a couple errors that I just kind of skipped over and I was wondering where they are from.
Everything was going swimmingly until I got to the part where I install MySQL-python. I'm actually using MySQL through XAMPP instead... so if that's the problem let me know.
I tried installing MySQL-python v1.2.3 and got this error:
Processing MySQL-python-1.2.3.win-amd64-py2.7.exe
creating 'c:\users\quentin\appdata\local\temp\easy_install-reydf8\MySQL_python-1.2.3-py2.7-win32.egg' and adding 'c:\users\quentin\appdata\local\temp\easy_install-reydf8\MySQL_python-1.2.3-py2.7-win32.egg.tmp' to it
Moving MySQL_python-1.2.3-py2.7-win32.egg to c:\virtualenvs\django_tutorial\lib\site-packages
Adding MySQL-python 1.2.3 to easy-install.pth file
Installed c:\virtualenvs\django_tutorial\lib\site-packages\mysql_python-1.2.3-py2.7-win32.egg
Processing dependencies for MySQL-python==1.2.3
Searching for MySQL-python==1.2.3
Reading http://pypi.python.org/simple/MySQL-python/
Best match: MySQL-python 1.2.3
Downloading https://pypi.python.org/packages/source/M/MySQL-python/MySQL-python-1.2.3.tar.gz#md5=215eddb6d853f6f4be5b4afc4154292f
Processing MySQL-python-1.2.3.tar.gz
Running MySQL-python-1.2.3\setup.py -q bdist_egg --dist-dir c:\users\quentin\appdata\local\temp\easy_install-cnlqlk\MySQL-python-1.2.3\egg-dist-tmp-iaalng
error: The system cannot find the file specified
So normally I would expect that 1.2.3 did not install, but I think it did because this command works...
python manage.py syncdb
So I'm kind of curious what that error message about not finding the system file is from.
I also tried installing v1.2.4 and I get a similar error about finding another file:
(django_tutorial) C:\django_projects\insults>easy_install file://c:/users/quentin/downloads/mysql-python-1.2.4.win-amd64-py2.7.exe
Processing mysql-python-1.2.4.win-amd64-py2.7.exe
creating 'c:\users\quentin\appdata\local\temp\easy_install-hz3ivi\MySQL_python-1.2.4-py2.7-win32.egg' and adding 'c:\users\quentin\appdata\local\temp\easy_install-hz3ivi\MySQL_python-1.2.4-py2.7-win32.egg.tmp' to it
Moving MySQL_python-1.2.4-py2.7-win32.egg to c:\virtualenvs\django_tutorial\lib\site-packages
Removing mysql-python 1.2.3 from easy-install.pth file
Adding MySQL-python 1.2.4 to easy-install.pth file
Installed c:\virtualenvs\django_tutorial\lib\site-packages\mysql_python-1.2.4-py2.7-win32.egg
Processing dependencies for MySQL-python==1.2.4
Searching for MySQL-python==1.2.4
Reading http://pypi.python.org/simple/MySQL-python/
Best match: MySQL-python 1.2.4
Downloading https://pypi.python.org/packages/source/M/MySQL-python/MySQL-python1.2.4.zip#md5=ddf2386daf10a97af115ffad2ed4a9a0
Processing MySQL-python-1.2.4.zip
Running MySQL-python-1.2.4\setup.py -q bdist_egg --dist-dir c:\users\quentin\appdata\local\temp\easy_install-v0_gfa\MySQL-python-1.2.4\egg-dist-tmp-2ltuob
Downloading http://pypi.python.org/packages/source/d/distribute/distribute-0.6.28.tar.gz
Extracting in c:\users\quentin\appdata\local\temp\easy_install-v0_gfa\MySQL-python-1.2.4\temp\tmpemj6wf
Now working in c:\users\quentin\appdata\local\temp\easy_install-v0_gfa\MySQL-python-1.2.4\temp\tmpemj6wf\distribute-0.6.28
Building a Distribute egg in c:\users\quentin\appdata\local\temp\easy_install-v0_gfa\MySQL-python-1.2.4
c:\users\quentin\appdata\local\temp\easy_install-v0_gfa\MySQL-python-1.2.4\distribute0.6.28-py2.7.egg
error: Setup script exited with error: Unable to find vcvarsall.bat
So yeah. Just kind of curious about those errors and whether or not I should be worried about them. I guess if things are working, I don't really have an problem but... others may also get confused about this and get stuck at the installation/setup part of working in django as well?
edit
ok it's not happy when I install 1.2.4, but if I just install 1.2.3 over it, syncdb works again.
MySQL-python 1.2.3/1.2.4
Django 1.5.1
XAMPP3.1.0, Apache2.4.3, MySQL5.5.32
Python 2.7.5 64-bit
Windows 7 64-bit
The main problem is here:
Setup script exited with error: Unable to find vcvarsall.bat
It means that your Cand C++ were not compiled. If you have installed Visual Studio 2012 recently, then follow my answer here, to find the solution to your problem.

Categories

Resources