Category Archives: Python

error: command ‘gcc’ failed with exit status 1

ERROR:

error: command ‘gcc’ failed with exit status 1
—————————————-
ERROR: Command errored out with exit status 1: /website/st_forum3/py3_forums/bin/python3 -u -c ‘import sys, setuptools, tokenize; sys.argv[0] = ‘”‘”‘/tmp/pip-install-irkz7or4/mysqlclient/setup.py'”‘”‘; __file__='”‘”‘/tmp/pip-install-irkz7or4/mysqlclient/setup.py'”‘”‘;f=getattr(tokenize, ‘”‘”‘open'”‘”‘, open)(__file__);code=f.read().replace(‘”‘”‘\r\n'”‘”‘, ‘”‘”‘\n'”‘”‘);f.close();exec(compile(code, __file__, ‘”‘”‘exec'”‘”‘))’ install –record /tmp/pip-record-95hukcvi/install-record.txt –single-version-externally-managed –compile –install-headers /website/st_forum3/py3_forums/include/site/python3.6/mysqlclient Check the logs for full command output.


Solution:

Tested In CentOS 7 : Python 3.6 Environment

sudo yum install python36 python36-devel python36-libs python36-tools gcc-c++

 

sudo yum install gcc-c++

 


pycurl: libcurl link-time ssl backend (nss) is different from compile-time ssl backend (openssl)

 

In CentOS/Fedora : Found issue with yum package.

There was a problem importing one of the Python modules
required to run yum. The error leading to this problem was:

pycurl: libcurl link-time ssl backend (nss) is different from compile-time ssl backend (openssl)

Please install a package which provides this module, or
verify that the module is installed correctly.

It’s possible that the above module doesn’t match the
current version of Python, which is:
2.7.5 (default, Nov 6 2016, 00:28:07)
[GCC 4.8.5 20150623 (Red Hat 4.8.5-11)]

If you cannot solve this problem yourself, please go to
the yum faq at:
http://yum.baseurl.org/wiki/Faq


 

Solution: Execute below commands in terminal.

#recompile pycurl

#upgrade pip

  •   pip install –upgrade pip

# Uninstall current pycurl

  • pip uninstall pycurl

#set PYCURL_SSL_LIBRARY

  • export PYCURL_SSL_LIBRARY=nss

# recompile and install pycurl

  • pip install –compile pycurl

# Run YUM package manager

  • yum clean all
  • yum update

Hope this post will helps..! Enjoy  🙂

 

 

 

Install memcache in CentOS 7

Memcached is a configurable memory object caching daemon that stores objects in memory to reduce database load in dynamic web applications.
It’s built on top of libevent to grow to any size, and it’s specially designed to minimise swapping and utilise non-blocking I/O wherever possible.

Memcached is high performance in memory cache system that is useful to speed up websites  which used heavy database. Memcached support many programming languages like PHP,Ruby,Python,Perl.


 

Install Memcached :

  • Clean up yum

         [root@linuxsysad ~]# yum clean all

  • Update yum packages

         [root@linuxsysad ~]# yum update

  • Install Memcached Package.

         [root@linuxsysad ~]# yum -y install memcached

  • Start Memcached service:

        [root@linuxsysad ~]# systemctl start memcached

  • configure to start memcached service at boot time.

         [root@linuxsysad ~]# systemctl enable memcached

 


 

Configure memcached :

The default configuration file can be found at:

/etc/sysconfig/memcached

When started, Memcached will start on port 11211 by default as per the default configuration file:

PORT=”11211″
USER=”memcached”
MAXCONN=”1024″
CACHESIZE=”64″
OPTIONS=””

CACHESIZE is default set in MB. For example we set CACHESIZE=”64″ means it is 64 MB.