Problem installing Cython

144 views
Skip to first unread message

Sujay Patil

unread,
Oct 1, 2017, 5:12:47 PM10/1/17
to Kivy users support
Hello, 

I apologise because I have a very basic question. I have a problem installing Cython and can't figure out a solution to it. Can anyone please help me ? I cannot proceed to Kivy installation without having Cython installed. 

ChhayaBdanesMBP:~ chhayabhadane$ pip install cython

Collecting cython

  Using cached Cython-0.27.1-cp27-cp27m-macosx_10_6_intel.macosx_10_9_intel.macosx_10_9_x86_64.macosx_10_10_intel.macosx_10_10_x86_64.whl

Installing collected packages: cython

Exception:

Traceback (most recent call last):

  File "/Library/Python/2.7/site-packages/pip/basecommand.py", line 215, in main

    status = self.run(options, args)

  File "/Library/Python/2.7/site-packages/pip/commands/install.py", line 342, in run

    prefix=options.prefix_path,

  File "/Library/Python/2.7/site-packages/pip/req/req_set.py", line 784, in install

    **kwargs

  File "/Library/Python/2.7/site-packages/pip/req/req_install.py", line 851, in install

    self.move_wheel_files(self.source_dir, root=root, prefix=prefix)

  File "/Library/Python/2.7/site-packages/pip/req/req_install.py", line 1064, in move_wheel_files

    isolated=self.isolated,

  File "/Library/Python/2.7/site-packages/pip/wheel.py", line 345, in move_wheel_files

    clobber(source, lib_dir, True)

  File "/Library/Python/2.7/site-packages/pip/wheel.py", line 323, in clobber

    shutil.copyfile(srcfile, destfile)

  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/shutil.py", line 83, in copyfile

    with open(dst, 'wb') as fdst:

IOError: [Errno 13] Permission denied: '/Library/Python/2.7/site-packages/cython.py'

ZenCODE

unread,
Oct 2, 2017, 1:54:20 AM10/2/17
to Kivy users support
try

    sudo pip install cython==0.25.2

Sujay Patil

unread,
Oct 2, 2017, 9:13:00 PM10/2/17
to Kivy users support
Thanks a lot Richard for taking the time to respond to my question. Unfortunately I have to bother you a little more. Cython installation succeeded with the instruction you suggested. But there seems to be a problem with the Kivy installation process. Can you tell me if I need to worry about this incomplete installation ? Are the modules or packages that were not installed critical to functioning of Kivy ? Please find the message on the terminal below : 

Building wheels for collected packages: kivy, Kivy-Garden

  Running setup.py bdist_wheel for kivy ... done

  Stored in directory: /Users/chhayabhadane/Library/Caches/pip/wheels/44/dc/e1/8f36be467f9d8c3b27d172a64a55b887212b86727684ca18e8

  Running setup.py bdist_wheel for Kivy-Garden ... done

  Stored in directory: /Users/chhayabhadane/Library/Caches/pip/wheels/27/08/88/88938a7cf5b20073ff1f0432b7c0dd172531185cc74d97f5da

Successfully built kivy Kivy-Garden

Installing collected packages: idna, urllib3, certifi, chardet, requests, Kivy-Garden, docutils, pygments, kivy

Exception:

Traceback (most recent call last):

  File "/Library/Python/2.7/site-packages/pip/basecommand.py", line 215, in main

    status = self.run(options, args)

  File "/Library/Python/2.7/site-packages/pip/commands/install.py", line 342, in run

    prefix=options.prefix_path,

  File "/Library/Python/2.7/site-packages/pip/req/req_set.py", line 784, in install

    **kwargs

  File "/Library/Python/2.7/site-packages/pip/req/req_install.py", line 851, in install

    self.move_wheel_files(self.source_dir, root=root, prefix=prefix)

  File "/Library/Python/2.7/site-packages/pip/req/req_install.py", line 1064, in move_wheel_files

    isolated=self.isolated,

  File "/Library/Python/2.7/site-packages/pip/wheel.py", line 345, in move_wheel_files

    clobber(source, lib_dir, True)

  File "/Library/Python/2.7/site-packages/pip/wheel.py", line 316, in clobber

    ensure_dir(destdir)

  File "/Library/Python/2.7/site-packages/pip/utils/__init__.py", line 83, in ensure_dir

    os.makedirs(path)

  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/os.py", line 157, in makedirs

    mkdir(name, mode)

OSError: [Errno 13] Permission denied: '/Library/Python/2.7/site-packages/idna'

ZenCODE

unread,
Oct 3, 2017, 3:44:17 PM10/3/17
to Kivy users support
It is strange that you still get permission errors after running the command as 'sudo', but perhaps you are not setup as a 'sudoer' on that machine? You could try using a virtual environment, which gives you much more leeway.

http://docs.python-guide.org/en/latest/dev/virtualenvs/

But something tells me that is not going to work. Below, you post an incomplete log. Please post the everything, the full log, that we might get more insight...

Thanks

Sujay Patil

unread,
Oct 4, 2017, 5:00:23 PM10/4/17
to Kivy users support
Please find below the complete log. 

Last login: Wed Oct  4 22:17:41 on console

ChhayaBdanesMBP:~ chhayabhadane$ pip install kivy

Collecting kivy

Collecting Kivy-Garden>=0.1.4 (from kivy)

Collecting pygments (from kivy)

  Using cached Pygments-2.2.0-py2.py3-none-any.whl

Collecting docutils (from kivy)

  Using cached docutils-0.14-py2-none-any.whl

Collecting requests (from Kivy-Garden>=0.1.4->kivy)

  Using cached requests-2.18.4-py2.py3-none-any.whl

Collecting idna<2.7,>=2.5 (from requests->Kivy-Garden>=0.1.4->kivy)

  Using cached idna-2.6-py2.py3-none-any.whl

Collecting urllib3<1.23,>=1.21.1 (from requests->Kivy-Garden>=0.1.4->kivy)

  Using cached urllib3-1.22-py2.py3-none-any.whl

Collecting certifi>=2017.4.17 (from requests->Kivy-Garden>=0.1.4->kivy)

  Using cached certifi-2017.7.27.1-py2.py3-none-any.whl

Collecting chardet<3.1.0,>=3.0.2 (from requests->Kivy-Garden>=0.1.4->kivy)

  Using cached chardet-3.0.4-py2.py3-none-any.whl

Installing collected packages: idna, urllib3, certifi, chardet, requests, Kivy-Garden, pygments, docutils, kivy

Exception:

Traceback (most recent call last):

  File "/Library/Python/2.7/site-packages/pip/basecommand.py", line 215, in main

    status = self.run(options, args)

  File "/Library/Python/2.7/site-packages/pip/commands/install.py", line 342, in run

    prefix=options.prefix_path,

  File "/Library/Python/2.7/site-packages/pip/req/req_set.py", line 784, in install

    **kwargs

  File "/Library/Python/2.7/site-packages/pip/req/req_install.py", line 851, in install

    self.move_wheel_files(self.source_dir, root=root, prefix=prefix)

  File "/Library/Python/2.7/site-packages/pip/req/req_install.py", line 1064, in move_wheel_files

    isolated=self.isolated,

  File "/Library/Python/2.7/site-packages/pip/wheel.py", line 345, in move_wheel_files

    clobber(source, lib_dir, True)

  File "/Library/Python/2.7/site-packages/pip/wheel.py", line 316, in clobber

    ensure_dir(destdir)

  File "/Library/Python/2.7/site-packages/pip/utils/__init__.py", line 83, in ensure_dir

    os.makedirs(path)

  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/os.py", line 157, in makedirs

    mkdir(name, mode)

OSError: [Errno 13] Permission denied: '/Library/Python/2.7/site-packages/idna'

ZenCODE

unread,
Oct 4, 2017, 7:39:07 PM10/4/17
to Kivy users support
The log shows you are not using sudo. Try:

    sudo pip install kivy


Sujay Patil

unread,
Oct 5, 2017, 4:29:15 PM10/5/17
to Kivy users support
I tried using 'sudo pip install kivy' but it didn't work. Please find the complete log below. Since it didn't work, I tried 'sudo -H pip install kivy'. It seems to have worked but I am sceptical. I have posted the log below as well. I am using my Mother's macbook that she gave me when she switched to Windows. Honestly speaking I don't know how to replace her sudo with mine. 

Last login: Thu Oct  5 21:37:50 on console

ChhayaBdanesMBP:~ chhayabhadane$ sudo pip install kivy

Password:

The directory '/Users/chhayabhadane/Library/Caches/pip/http' or its parent directory is not owned by the current user and the cache has been disabled. Please check the permissions and owner of that directory. If executing pip with sudo, you may want sudo's -H flag.

The directory '/Users/chhayabhadane/Library/Caches/pip' or its parent directory is not owned by the current user and caching wheels has been disabled. check the permissions and owner of that directory. If executing pip with sudo, you may want sudo's -H flag.

Collecting kivy

Collecting Kivy-Garden>=0.1.4 (from kivy)

Collecting pygments (from kivy)

  Downloading Pygments-2.2.0-py2.py3-none-any.whl (841kB)

    100% |████████████████████████████████| 849kB 687kB/s 

Collecting docutils (from kivy)

  Downloading docutils-0.14-py2-none-any.whl (543kB)

    100% |████████████████████████████████| 552kB 919kB/s 

Collecting requests (from Kivy-Garden>=0.1.4->kivy)

  Downloading requests-2.18.4-py2.py3-none-any.whl (88kB)

    100% |████████████████████████████████| 92kB 1.2MB/s 

Collecting idna<2.7,>=2.5 (from requests->Kivy-Garden>=0.1.4->kivy)

  Downloading idna-2.6-py2.py3-none-any.whl (56kB)

    100% |████████████████████████████████| 61kB 1.9MB/s 

Collecting urllib3<1.23,>=1.21.1 (from requests->Kivy-Garden>=0.1.4->kivy)

  Downloading urllib3-1.22-py2.py3-none-any.whl (132kB)

    100% |████████████████████████████████| 133kB 1.1MB/s 

Collecting certifi>=2017.4.17 (from requests->Kivy-Garden>=0.1.4->kivy)

  Downloading certifi-2017.7.27.1-py2.py3-none-any.whl (349kB)

    100% |████████████████████████████████| 358kB 960kB/s 

Collecting chardet<3.1.0,>=3.0.2 (from requests->Kivy-Garden>=0.1.4->kivy)

  Downloading chardet-3.0.4-py2.py3-none-any.whl (133kB)

    100% |████████████████████████████████| 143kB 1.1MB/s 

Installing collected packages: idna, urllib3, certifi, chardet, requests, Kivy-Garden, pygments, docutils, kivy

Exception:

Traceback (most recent call last):

  File "/Library/Python/2.7/site-packages/pip/basecommand.py", line 215, in main

    status = self.run(options, args)

  File "/Library/Python/2.7/site-packages/pip/commands/install.py", line 342, in run

    prefix=options.prefix_path,

  File "/Library/Python/2.7/site-packages/pip/req/req_set.py", line 784, in install

    **kwargs

  File "/Library/Python/2.7/site-packages/pip/req/req_install.py", line 851, in install

    self.move_wheel_files(self.source_dir, root=root, prefix=prefix)

  File "/Library/Python/2.7/site-packages/pip/req/req_install.py", line 1064, in move_wheel_files

    isolated=self.isolated,

  File "/Library/Python/2.7/site-packages/pip/wheel.py", line 377, in move_wheel_files

    clobber(source, dest, False, fixer=fixer, filter=filter)

  File "/Library/Python/2.7/site-packages/pip/wheel.py", line 316, in clobber

    ensure_dir(destdir)

  File "/Library/Python/2.7/site-packages/pip/utils/__init__.py", line 83, in ensure_dir

    os.makedirs(path)

  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/os.py", line 150, in makedirs

    makedirs(head, mode)

  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/os.py", line 150, in makedirs

    makedirs(head, mode)

  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/os.py", line 157, in makedirs

    mkdir(name, mode)

OSError: [Errno 1] Operation not permitted: '/System/Library/Frameworks/Python.framework/Versions/2.7/share'


ChhayaBdanesMBP:~ chhayabhadane$ sudo -H pip install kivy

Requirement already satisfied: kivy in /Library/Python/2.7/site-packages

Requirement already satisfied: Kivy-Garden>=0.1.4 in /Library/Python/2.7/site-packages (from kivy)

Requirement already satisfied: pygments in /Library/Python/2.7/site-packages (from kivy)

Requirement already satisfied: docutils in /Library/Python/2.7/site-packages (from kivy)

Requirement already satisfied: requests in /Library/Python/2.7/site-packages (from Kivy-Garden>=0.1.4->kivy)

Requirement already satisfied: idna<2.7,>=2.5 in /Library/Python/2.7/site-packages (from requests->Kivy-Garden>=0.1.4->kivy)

Requirement already satisfied: urllib3<1.23,>=1.21.1 in /Library/Python/2.7/site-packages (from requests->Kivy-Garden>=0.1.4->kivy)

Requirement already satisfied: certifi>=2017.4.17 in /Library/Python/2.7/site-packages (from requests->Kivy-Garden>=0.1.4->kivy)

Requirement already satisfied: chardet<3.1.0,>=3.0.2 in /Library/Python/2.7/site-packages (from requests->Kivy-Garden>=0.1.4->kivy)

Sujay Patil

unread,
Oct 14, 2017, 7:23:51 AM10/14/17
to Kivy users support
Hello Richard, 

I managed to install it using : sudo -H pip install kivy 
And I tested it by writing a few lines of code. Thanks for your help. 


Le jeudi 5 octobre 2017 01:39:07 UTC+2, ZenCODE a écrit :
Reply all
Reply to author
Forward
0 new messages