where to get and install crypto.dll on 64 bit Windows - python

Note: This is not an issue with Visual Studio, but rather with incompatible dll versions. The steps below replicate the problem since running in Visual Studio in debug mode breaks on exceptions being thrown. If you just run, the thrown exception is handled elsewhere and the program works fine. But since I spend a lot of time in debug mode, I would prefer to fix this problem.
When debugging, I want to be able to step into modules I have added to my Virtual Environment in Visual Studio. I get a 'library not found' error that I am not able to fix. Here are the steps:
In Visual Studio create a new Python Application.
Create a virtual environment for that application (Python 3.6 64
bit).
pip install twilio into your virtual environment. You get the
following output.
...
----- Installing 'twilio' -----
Collecting twilio
Using cached twilio-6.10.5-py2.py3-none-any.whl
Collecting pytz (from twilio)
Using cached pytz-2018.3-py2.py3-none-any.whl
Collecting six (from twilio)
Using cached six-1.11.0-py2.py3-none-any.whl
Collecting PyJWT>=1.4.2 (from twilio)
Using cached PyJWT-1.6.0-py2.py3-none-any.whl
Collecting requests>=2.0.0; python_version >= "3.0" (from twilio)
Using cached requests-2.18.4-py2.py3-none-any.whl
Collecting pysocks; python_version >= "3.0" (from twilio)
Using cached PySocks-1.6.8.tar.gz
Collecting certifi>=2017.4.17 (from requests>=2.0.0; python_version >= "3.0"->twilio)
Using cached certifi-2018.1.18-py2.py3-none-any.whl
Collecting chardet<3.1.0,>=3.0.2 (from requests>=2.0.0; python_version >= "3.0"->twilio)
Using cached chardet-3.0.4-py2.py3-none-any.whl
Collecting urllib3<1.23,>=1.21.1 (from requests>=2.0.0; python_version >= "3.0"->twilio)
Using cached urllib3-1.22-py2.py3-none-any.whl
Collecting idna<2.7,>=2.5 (from requests>=2.0.0; python_version >= "3.0"->twilio)
Using cached idna-2.6-py2.py3-none-any.whl
Installing collected packages: pytz, six, PyJWT, certifi, chardet, urllib3, idna, requests, pysocks, twilio
Running setup.py install for pysocks: started
Running setup.py install for pysocks: finished with status 'done'
Successfully installed PyJWT-1.6.0 certifi-2018.1.18 chardet-3.0.4 idna-2.6 pysocks-1.6.8 pytz-2018.3 requests-2.18.4 six-1.11.0 twilio-6.10.5 urllib3-1.22
----- Successfully installed 'twilio' -----
Add the following line to the top of your .py file:
from twilio.rest import Client
In Visual Studio go to tools > options > python > debugging. Make
sure 'Enable debugging of Python standard library' is checked
Run the application. You get the following error:
ModuleNotFoundError: No module named 'OpenSSL'
pip install pyopenssl You get the following output:
...
----- Installing 'pyopenssl' -----
Collecting pyopenssl
Using cached pyOpenSSL-17.5.0-py2.py3-none-any.whl
Requirement already satisfied: six>=1.5.2 in c:\users\x\source\repos\pythonapplication9\pythonapplication9\env\lib\site-packages (from pyopenssl)
Collecting cryptography>=2.1.4 (from pyopenssl)
Using cached cryptography-2.1.4-cp36-cp36m-win_amd64.whl
Requirement already satisfied: idna>=2.1 in c:\users\x\source\repos\pythonapplication9\pythonapplication9\env\lib\site-packages (from cryptography>=2.1.4->pyopenssl)
Collecting cffi>=1.7; platform_python_implementation != "PyPy" (from cryptography>=2.1.4->pyopenssl)
Using cached cffi-1.11.5-cp36-cp36m-win_amd64.whl
Collecting asn1crypto>=0.21.0 (from cryptography>=2.1.4->pyopenssl)
Using cached asn1crypto-0.24.0-py2.py3-none-any.whl
Collecting pycparser (from cffi>=1.7; platform_python_implementation != "PyPy"->cryptography>=2.1.4->pyopenssl)
Using cached pycparser-2.18.tar.gz
Installing collected packages: pycparser, cffi, asn1crypto, cryptography, pyopenssl
Running setup.py install for pycparser: started
Running setup.py install for pycparser: finished with status 'done'
Successfully installed asn1crypto-0.24.0 cffi-1.11.5 cryptography-2.1.4 pycparser-2.18 pyopenssl-17.5.0
----- Successfully installed 'pyopenssl' -----
Run the application. You get the following error:
asn1crypto._ffi.LibraryNotFoundError: The library libcrypto could not be found
The error is thrown in the file named _big_num_ctypes.py in asn1crypto. The code line where this is thrown is:
libcrypto_path = find_library(b'crypto' if sys.version_info < (3,) else 'crypto')
if not libcrypto_path:
raise LibraryNotFoundError('The library libcrypto could not be found')
Update: I was asked to provide the full backtrace. I modified the code in this way to print it:
import unittest
import traceback
class Test_test1(unittest.TestCase):
def test_A(self):
try:
from twilio.rest import Client
except Exception as e:
print('foo')
foo = traceback.extract_stack()
traceback.print_exc(e)
if __name__ == '__main__':
unittest.main()
As before the import line throws the exception but the exception is not caught and the lines in 'except' clause are never executed
from twilio.rest import Client
update 2: I somehow had gotten this to work following #Prateek and #user8212173. But now it is not working again. As both suggested, the problem is that crypto.dll is not there. So I went thru the steps below to add it with no success:
I installed Win64 OpenSSL v1.1.0j from https://slproweb.com/products/Win32OpenSSL.html (pointed to from https://wiki.openssl.org/index.php/Binaries). It does not contain crypto.dll.
I then installed crypto.dll from http://www.dlldownloader.com/crypto-dll/ (as #user8212173 suggested) (there is only a 32 bit version) and followed the instructions. I then got a new error message "ImportError: DLL load failed: %1 is not a valid Win32 application" which means that the crypto.dll I installed has a version conflict (I am running 64bit python on a 64bit computer). I remember installing it from Unofficial Windows Binaries for Python Extension Packages I can't find it there. So where do I get a working 64bit version of crypto.dll?

I searched a lot and could find that you are missing crypto.dll file. Your code is looking for this dll file and it is unable to find it.
Please note this wont be installed by pip install crypto as this is python library and the code is looking for a dll file.
ctypes.util.find_library searches for dll file from windows environment path variable.
Reference : find_library() in ctypes
To verify I checked.
find_library('l2gpstore')
>>'C:\\WINDOWS\\system32\\l2gpstore.dll'
find_library('java')
>>'C:\\Program Files\\Java\\jdk-9.0.4\\bin\\java.dll'
Furthermore you should install OpenSSL with libcrypto module from here
OpenSSL
OpenSSL installation instructions
The master sources are maintained in our git repository, which is
accessible over the network and cloned on GitHub, at
https://github.com/openssl/openssl. Bugs and pull patches (issues and
pull requests) should be file on the GitHub repo. Please familiarize
yourself with the license.
libcrypto with respect to OpenSSL
reference : GitHub
libcrypto (with platform specific naming):
Provides general cryptographic and X.509 support needed by SSL/TLS but
not logically part of it.
Once you install binaries and check crypto.dll is available in one of the path strings in your environment variables this issue should be resolved.
If not add it into path variable and check.
Update:
Update since the question has been updated and the issue has recurred.
There are architectural changes with OpenSSL 1.1.0 as compared to 1.0.2
September 13, 2018 - OpenSSL 1.1.0 and later are quite different from previous releases. Users should install BOTH the 1.0.2 series (LTS) and the 1.1.1 (LTS) series for maximum application compatibility. Developers need to recompile their software to support 1.1.1. See the official OpenSSL release strategy document for more details. – Prateek yesterday
If you open 1.0.2 from Github you can see crypto.h file , the same file is missing in latest version. Also OpenSSL there is change in DLL names , they renamed libeay32 to libcrypto
You need to post code which makes use of asn1crypto library in the post. There is no code that explicitly uses asn1crypto in your post. So, not able to reproduce your issue using pipenv.
Make sure you are using updated libraries too.
I would not recommend downloading DLL source from unreliable source like DLLdownloader
If you are having issues with latest version of OpenSSL and asn1crypto its better to downgrade OpenSSL to 1.0.2 ,I think that would work considering it ships with crypto.h file.
Good luck!

I tried to reproduce the error on my computer and was successful when I ran the "error-producing" file _big_num_ctypes.py. Although, I do not have Visual Studio, the error stems from the missing crypto.dll file. We will deduce this step-by-step. Let's first examine the error causing code snippet in the file _big_num_ctypes.py:
#imports
from ctypes.util import find_library
.
.
from .._ffi import LibraryNotFoundError, FFIEngineError
try:
# On Python 2, the unicode string here may raise a UnicodeDecodeError as it
# tries to join a bytestring path to the unicode name "crypto"
libcrypto_path = find_library(b'crypto' if sys.version_info < (3,) else 'crypto')
if not libcrypto_path:
raise LibraryNotFoundError('The library libcrypto could not be found')
.
.
except (AttributeError):
raise FFIEngineError('Error initializing ctypes')
I ran the file:
C:\>cd "C:\ProgramData\Anaconda3\Lib\site-packages\asn1crypto\_perf"
C:\ProgramData\Anaconda3\Lib\site-packages\asn1crypto\_perf>python _big_num_ctypes.py
and had a Traceback for the library import:
Traceback (most recent call last):
File "_big_num_ctypes.py", line 27, in <module>
from .._ffi import LibraryNotFoundError, FFIEngineError
ValueError: attempted relative import beyond top-level package
So, I changed the import path for.ffito:
from asn1crypto._ffi import LibraryNotFoundError, FFIEngineError
On the second run, the missing libcrypto library error appeared:
asn1crypto._ffi.LibraryNotFoundError: The library libcrypto could not be found
The exception is raised when the dll library named crypto could not be found at C:\Windows\System32 and/or SYSWOW64(for 64-bit)
libcrypto_path = find_library(b'crypto' if sys.version_info < (3,) else 'crypto')
The purpose of find_library is to find a specified library and return a pathname. The behavior of this method varies with OS as described in the docs. If this method cannot find any packages, it returns None.
>>> from ctypes.util import find_library
>>> print(find_library("c"))
None
In our case, the search is for crypto.dll and I couldn't find this file on my computer. So, I downloaded and installed it exactly according to the instructions here. When I checked again:
>>> find_library('crypto')
'C:\\windows\\system32\\crypto.dll'
Now I ran python _big_num_ctypes.py again and got a different Traceback:
Traceback (most recent call last):
File "_big_num_ctypes.py", line 37, in <module>
libcrypto = CDLL(libcrypto_path)
File "C:\ProgramData\Anaconda3\lib\ctypes\__init__.py", line 348, in __init__
self._handle = _dlopen(self._name, mode)
OSError: [WinError 193] %1 is not a valid Win32 application
A further investigation into the above error revealed that if I'm using a 32bit DLL with 64bit Python, or vice-versa, then I may get such errors as explained here. So, I installed Python 3.6 32-bit and tried again with py -3.6-32 _big_num_ctypes.py. I also installed all the required packages, but this error persisted.
Could it be possible that we may require 32-bit binaries for the Crypto package? This answer and this give more information.
I realized that Pycryptodome is a regularly maintained package and is preferred over the old Crypto package but can still be installed under Crypto. Another point to notice is that one of the requirements for this package is MS Visual Studio 2015 (Community Edition) and the C/C++ compilers and the redistributable only. It could be possible that some C++ compiler files or MS Visual Studio files are missing at present and causing these issues to happen.
If you install all the above prerequisites, the crypto.dll file and the Pycryptodomepackage, I believe this error will be Resolved. You have already installed other required packages OpenSSL & Twilio. Unfortunately, I am restricted to install MS Visual Studio on my computer and so I couldn't test this further.
I also ran the unittest code and it ran successfully for me:
#Output
.
----------------------------------------------------------------------
Ran 1 test in 0.771s
OK

Here is my solution for windows 10, visual studio community 2017,
open file C:\Program Files (x86)\Microsoft Visual Studio\Shared\Python36_64\Lib\site-packages\asn1crypto_perf_big_num_ctypes.py and then change the code from :
libcrypto_path = find_library(b'crypto' if sys.version_info < (3,) else 'crypto')
to:
libcrypto_path = find_library(b'crypto' if sys.version_info < (3,) else 'libcrypto')
then the error msg is gone.
The libcrypto.dll is already under folder C:\Windows\System32\

Related

After using pip, I get the error "Scikit-learn has not been built correctly"

I'm using a Jetson Nano and I already tried reinstalling tensorflow (tried different versions) and numpy (also different versions). I'm using the pip3 commands, since I'm using python3 (version 3.6.9).
Downgrading everything didn't work, since Keras needs tensorflow >2.2
I also tried reinstalling scikit-learn, using the --force-reinstall flag.
Since it might be helpful, here is the full error message I receive when trying to run my program:
Traceback (most recent call last):
File "/home/nano/.local/lib/python3.6/site-packages/sklearn/__check_build/__init__.py", line 44, in <module>
from ._check_build import check_build # noqa
ImportError: /home/nano/.local/lib/python3.6/site-packages/sklearn/__check_build/../../scikit_learn.libs/libgomp-d22c30c5.so.1.0.0: cannot allocate memory in static TLS block
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "LSTMMVMSTSF.py", line 4, in <module>
import sklearn
File "/home/nano/.local/lib/python3.6/site-packages/sklearn/__init__.py", line 81, in <module>
from . import __check_build # noqa: F401
File "/home/nano/.local/lib/python3.6/site-packages/sklearn/__check_build/__init__.py", line 46, in <module>
raise_build_error(e)
File "/home/nano/.local/lib/python3.6/site-packages/sklearn/__check_build/__init__.py", line 41, in raise_build_error
%s""" % (e, local_dir, ''.join(dir_content).strip(), msg))
ImportError: /home/nano/.local/lib/python3.6/site-packages/sklearn/__check_build/../../scikit_learn.libs/libgomp-d22c30c5.so.1.0.0: cannot allocate memory in static TLS block
___________________________________________________________________________
Contents of /home/nano/.local/lib/python3.6/site-packages/sklearn/__check_build:
__init__.py _check_build.cpython-36m-aarch64-linux-gnu.so__pycache__
setup.py
___________________________________________________________________________
It seems that scikit-learn has not been built correctly.
If you have installed scikit-learn from source, please do not forget
to build the package before using it: run `python setup.py install` or
`make` in the source directory.
If you have used an installer, please check that it is suited for your
Python version, your operating system and your platform.
Edit: I forgot to add information on the installation of scikit-learn. I used sudo pip3 install scikit-learn. The logs of that installment:
sudo pip3 install scikit-learn Looking in indexes: https://pypi.org/simple, https://pypi.ngc.nvidia.com
Collecting scikit-learn
Downloading scikit_learn-0.24.2-cp36-cp36m-manylinux2014_aarch64.whl (24.0 MB)
|████████████████████████████████| 24.0 MB 20.5 MB/s
Requirement already satisfied: threadpoolctl>=2.0.0 in /home/nano/.local/lib/python3.6/site-packages (from scikit-learn) (2.1.0)
Requirement already satisfied: joblib>=0.11 in /home/nano/.local/lib/python3.6/site-packages (from scikit-learn) (1.0.1)
Requirement already satisfied: numpy>=1.13.3 in /home/nano/.local/lib/python3.6/site-packages (from scikit-learn) (1.19.0)
Requirement already satisfied: scipy>=0.19.1 in /home/nano/.local/lib/python3.6/site-packages (from scikit-learn) (1.5.4)
Installing collected packages: scikit-learn
Successfully installed scikit-learn-0.24.2
I found the answer in another post:
There is no actual issue with installing, the order of imports just needs to be changed. In my case, I had to make sklearn the first import. Further reading here
For those who cannot change import order (For example, library which uses sklearn raises error), I resolved this problem by setting environment variable LD_PRELOAD to path to libgomp-d22c30c5.so.1.0.0.
export LD_PRELOAD='/PATH/TO/libgomp-d22c30c5.so.1.0.0'
And execute program again.
You need to install the tensorflow whl specific to aarch64 architecture. The prebuilt tensorflow binaries for aarch64 are provided by nvidia at the following location
https://developer.download.nvidia.com/compute/redist/jp/v44/
This link is for jetpack 4.4 (v44). Update the link based on the jetpack version you are using.

Jnius installation bug, "Unable to determine JDK_HOME"

I tried to install jnius Python module by typing 'pip install jnius' in CMD.
This is the message I got:
Complete output from command python setup.py egg_info:
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "c:\users\sm\appdata\local\temp\pip-install-vu2sb5\jnius\setup.py", line 111, in <module>
raise Exception('Unable to determine JDK_HOME')
Exception: Unable to determine JDK_HOME
----------------------------------------
Command "python setup.py egg_info" failed with error code 1 in
c:\users\sm\appdata\local\temp\pip-install-vu2sb5\jnius\
I restarted CMD, but it didn't help.
I have finally resolved it. I have installed Cython before this happened and I installed both Java JDK and JRE after #Chris comment. And I have also added JAVA_HOME and JDK_HOME to system variables.Thank you #Chris, but it didn't resolve problem completely.
Then I got another error message. There was written that I have to install Microsoft Visual C++ Compiler for Python 2.7 from this page:
https://www.microsoft.com/en-us/download/confirmation.aspx?id=44266
After that I tried to install jnius again but the error message said that permission is denied so I ran CMD as administrator and finally installed jnius by typing pip install jnius.
I spent a lot of time to resolve it and hope that it will help everyone with same or similar problem.
I have resolved the problem in windows os.
1st step:
I have installed cython by using pip install cython
C:\Users>pip install cython
Collecting cython
Downloading Cython-0.29.22-cp38-cp38-win_amd64.whl (1.7 MB)
|████████████████████████████████| 1.7 MB 1.3 MB/s
Installing collected packages: cython
Successfully installed cython-0.29.22
2nd step:
I have installed jnius by using pip install pyjnius command
C:\Users>pip install pyjnius
Collecting pyjnius
Downloading pyjnius-1.3.0-cp38-cp38-win_amd64.whl (226 kB)
|████████████████████████████████| 226 kB 3.2 MB/s
Requirement already satisfied: cython in c:\users\sss\appdata\local\programs\python\python38\lib\site-packages (from pyjnius) (0.29.22)
Requirement already satisfied: six>=1.7.0 in c:\users\sss\appdata\local\programs\python\python38\lib\site-packages (from pyjnius) (1.15.0)
Installing collected packages: pyjnius
Successfully installed pyjnius-1.3.0
I hope this solves your problem.
The thing that worked for me was simply adding JAVA_HOME and JDK_HOME variables.

Installing the pypiwin32 module

I get this error when I run a program:
---------------------------------------------------------------------------
ModuleNotFoundError Traceback (most recent call last)
<ipython-input-10-b045b37982bc> in <module>()
4 #speech recognition
5 import speech_recognition as sr
----> 6 import win32com.client
7 import comtypes.client
8 #speech synthesis
ModuleNotFoundError: No module named 'win32com'
---------------------------------------------------
When I tried to install the pypiwin32 module, I got this error:
Collecting pypiwin32
Using cached pypiwin32-223-py3-none-any.whl
Collecting pywin32>=223 (from pypiwin32)
Could not find a version that satisfies the requirement pywin32>=223 (from pypiwin32) (from versions: )
No matching distribution found for pywin32>=223 (from pypiwin32)
The problem is that pypiwin32 depends on pywin32, and, as the README says:
Note that PIP support is experimental.
Even if pip installs pywin32, you still have to manually run the post-install script with elevated privileges. So, rather than debugging why the experimental pip support isn't working for you, it's probably better to manually download the appropriate installer from the Releases page and run it.
Once that completes, pip should know that you now have pywin32 version 223 installed, so pip install pypiwin32 should hopefully work.
You might want to look through the pywin32 issues to see if anyone has reported this problem (it may only be mentioned in some issue about completing pip support, not a separate one) and, if not, file a bug report. That way, the next time someone wants to use pypiwin32, they may not even need this answer. (Since Mark Hammond, the main author of pywin32, is also listed as a maintainer of pypiwin32, I'm guessing he already knows about it—but it can't hurt to check.)

PyInstaller won't install, Python 3.6.0a4 and x64 Windows

I have said Python version (from https://www.python.org/downloads/windows/), and x64 Windows 10.
Every time I try to execute "pip install pyinstaller" it crashes with an error:
C:\WINDOWS\system32>pip install pyinstaller
Collecting pyinstaller
Using cached PyInstaller-3.2.tar.gz
Requirement already satisfied (use --upgrade to upgrade): setuptools in c:\users\jskurski\appdata\local\programs\python\python36\lib\site-packages (from pyinstaller)
Collecting pefile (from pyinstaller)
Using cached pefile-2016.3.28.tar.gz
Collecting pypiwin32 (from pyinstaller)
Using cached pypiwin32-219.zip
Complete output from command python setup.py egg_info:
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "C:\Users\jskurski\AppData\Local\Temp\pip-build-y9lsbd5f\pypiwin32\setup.py", line 121
print "Building pywin32", pywin32_version
^
SyntaxError: Missing parentheses in call to 'print'
----------------------------------------
Command "python setup.py egg_info" failed with error code 1 in C:\Users\jskurski\AppData\Local\Temp\pip-build-y9lsbd5f\pypiwin32\
So, for me it seems there is a version msmatch or something. Unofortunately, I can not figure it out myself.
Any suggestions?
Has anybody sucessfully used PyInstaller with latest 3.6 Python on Windows? Or maybe I should downgrade Python to older version?
edit: tested on another PC (same enviroment) and it was the same.
edit2: seems to work on 3.5.2 version, so it's probably a way to go, for now.
pyinstaller needs pypiwin32 module.
when pip tries to install it, it shows an error because there is no pypiwin32 for python3.6
Case is closed for me, as I downgraded to stable 3.5.2. Probably some inconsistency in that alpha release, which caused this. I just wanted to write a simple GUI Windows program, so I will not investigate further.
You have to install manually pywin32 according to your version of python. The following link you can download.
https://sourceforge.net/projects/pywin32/files/pywin32/Build%20221/
Once installed pywin32 with your right version of python. Pyinstaller must be installed
As cdarke pointed out, you are running python 2 code on Python 3.
Try this instead:
pip3 install pyinstaller

Resolving Python package version conflict in Reddit install

I'm trying to get the Python libraries for Reddit installed on my Mac. I want to run them using PyCharm for development as I like it as a Python IDE.
I'm running the Cassandra, Memcached, RabbitMQ, and Postgres servers inside a Virtual Box instance that is accessible via the Virtual Box Host-only adapter. This is working as I can start Reddit in the Virtual Box and access it from my Mac just fine.
When running the paster script to see if the Reddit Python source install is working on the Mac. I get the following error:
Traceback (most recent call last):
File "/Users/inflector/software/new-day/reddit/dev/bin/paster", line 8, in <module>
load_entry_point('PasteScript==1.7.5', 'console_scripts', 'paster')()
File "/Users/inflector/software/new-day/reddit/dev/lib/python2.7/site-packages/paste/script/command.py", line 93, in run
commands = get_commands()
File "/Users/inflector/software/new-day/reddit/dev/lib/python2.7/site-packages/paste/script/command.py", line 135, in get_commands
plugins = pluginlib.resolve_plugins(plugins)
File "/Users/inflector/software/new-day/reddit/dev/lib/python2.7/site-packages/paste/script/pluginlib.py", line 82, in resolve_plugins
pkg_resources.require(plugin)
File "build/bdist.linux-i686/egg/pkg_resources.py", line 666, in require
File "build/bdist.linux-i686/egg/pkg_resources.py", line 569, in resolve
pkg_resources.VersionConflict: (WebOb 1.2.3 (/Users/inflector/software/new-day/reddit/dev/lib/python2.7/site-packages), Requirement.parse('webob==1.0.8'))
If I downgrade the installation to WebOb 1.0.8, I get the reverse, it wants 'WebOb>=1.2'.
'pip list' shows these packages installed:
amqplib (1.0.2)
Babel (0.9.6)
bcrypt (1.0.2)
Beaker (1.6.4)
BeautifulSoup (3.2.1)
beautifulsoup4 (4.2.1)
boto (2.9.5)
cffi (0.6)
chardet (2.1.1)
crypto (1.1.0)
cssutils (0.9.5.1)
Cython (0.19.1)
decorator (3.4.0)
FormEncode (1.2.6)
kazoo (1.1)
l2cs (2.0.2)
lxml (3.2.1)
Mako (0.8.1)
MarkupSafe (0.18)
nose (1.3.0)
Paste (1.7.5.1)
PasteDeploy (1.5.0)
PasteScript (1.7.5)
PIL (1.1.7)
psycopg2 (2.5)
py-bcrypt (0.3)
pyasn1 (0.1.7)
PyCAPTCHA (0.4)
pycassa (1.9.0)
pycountry (0.14.8)
pycparser (2.09.1)
pycrypto (2.6)
Pygments (1.6)
pylibmc (1.2.3)
Pylons (0.9.7)
pytz (2013b)
repoze.lru (0.6)
requests (1.2.3)
Routes (1.11)
rsa (3.1.1)
simplejson (3.3.0)
six (1.3.0)
snudown (1.1.5)
SQLAlchemy (0.7.4)
stripe (1.9.1)
Tempita (0.5.1)
thrift (0.9.0)
waitress (0.8.5)
WebError (0.10.3)
WebHelpers (1.3)
WebOb (1.2.3)
WebTest (2.0.6)
Whoosh (2.4.1)
wsgiref (0.1.2)
zope.interface (4.0.5)
My hypothesis is that at least one of these packages requires WebOb==1.0.8 and at least one other requires WebOb>=1.2
I've setup a virtualenv for the Reddit install and set it up with the --no-site-packages option so that I'm only dealing with the packages I need for Reddit. I manually installed everything that I think I need. So this is actually the minimum set of packages. I need each of them, but perhaps not all of them are the correct versions. The Reddit installer doesn't specify versions for every package, only some of them.
So how do I track down these dependencies? How do I get a list of the requirements for each of the packages installed in the virtualenv?
And where is the file: "build/bdist.linux-i686/egg/pkg_resources.py" coming from? I can't find it anywhere in my system. And the Mac is not linux so this seems odd.
I'm a very experienced programmer, C++, Java, Object Pascal, Objective C, etc. but not an expert Python programmer yet. So the Python package system is too much of a black box to me at this point. I can use pip and run setup.py scripts but I don't yet grok them.
The problem was coming from having a version 2.0.6 of the WebTest library. This version was the one requiring WebOb>=1.2.
To determine the requirements for the python modules. I cd'd into the site-packages directory for the virtual env and then ran:
grep WebOb *.egg-info/requires.txt
which returned:
Pylons-0.9.7-py2.7.egg-info/requires.txt:WebOb>=0.9.6.1
WebError-0.10.3-py2.7.egg-info/requires.txt:WebOb
WebTest-2.0.6-py2.7.egg-info/requires.txt:WebOb>=1.2
where I was able to see that WebTest was the conflicting package.
I was then able to go into my Ubuntu install to see what package for WebTest was installed found that WebTest 1.3.3 worked on the standard Ubuntu Reddit install. So I uninstalled both WebOb 1.2 and WebTest 2.0.6 and then ran:
pip install webob==1.0.8
pip install webtest==1.3.3
This got rid of the conflict WebOb versions conflict. I still can't yet get Reddit to run, but at least I removed this block.
Reddit's installer adds an Ubuntu private package repository. The PPA includes many variants of Ubuntu python packages.
If you are running Ubuntu, you can also install the PPA.

Categories

Resources