1

I am getting this error while running a python script to send file on S3

File "docs/setup/s3transfer.py", line 121, in <module>
    main(*args, **kwargs)
  File "docs/setup/s3transfer.py", line 28, in main
    conn = boto.connect_s3(access_key, sceret_key)
  File "/usr/local/lib/python2.6/site-packages/boto/__init__.py", line 140, in connect_s3
    from boto.s3.connection import S3Connection
  File "/usr/local/lib/python2.6/site-packages/boto/s3/connection.py", line 30, in <module>
    from boto.auth import detect_potential_s3sigv4
  File "/usr/local/lib/python2.6/site-packages/boto/auth.py", line 34, in <module>
    import boto.utils
  File "/usr/local/lib/python2.6/site-packages/boto/utils.py", line 57, in <module>
    import gzip
  File "/usr/local/lib/python2.6/gzip.py", line 9, in <module>
    import zlib
ImportError: No module named zlib

although when i do

sudo yum install zlib-devel

I get :

Loaded plugins: fastestmirror, versionlock
Loading mirror speeds from cached hostfile
 * base: centos.myfahim.com
 * epel: kartolo.sby.datautama.net.id
 * extras: centos.myfahim.com
 * updates: centos.myfahim.com
Package zlib-devel-1.2.7-17.el7.x86_64 already installed and latest version
Nothing to do

Can someone please help?

user2991413
  • 521
  • 2
  • 9
  • 26

2 Answers2

0

I know this is an older question, but in case someone finds this, like I did, I had the same issue with an older script that requires python3.5. After a recent update of MacPorts, it brought my py3.5 up to 3.5.10_5 I'd tried multiple fixes, and none of them worked. With MacPorts, activating a specific version will deactivate other versions. So, I tried the previous release, and the script started working again.

I ran:

sudo port installed python35 
  The following ports are currently installed:
    python35 @3.5.10_4
    python35 @3.5.10_5 (active)

Followed by:

sudo port activate python35 @3.5.10_4
--->  Computing dependencies for python35
--->  Deactivating python35 @3.5.10_5
--->  Cleaning python35
--->  Activating python35 @3.5.10_4
--->  Cleaning python35

Hope this helps someone else.

LOlliffe
  • 1,647
  • 5
  • 22
  • 43
0

Ran into this recently on centos 7 This should help

sudo ./configure --enable-optimizations --enable-loadable-sqlite-extensions
sudo make
sudo make altinstall
Stephinext
  • 487
  • 2
  • 6
  • 14