Jump to content
Fórum Script Brasil
  • 0

Instalação do Python no Mountain Lion


Ollie
 Share

Question

Fala pessoal.

Sou novo por aqui, entrei para um projeto com um amigo e decidimos utilizar o Python como linguagem para nosso projeto. Curso Engenharia de Computação e já programo um pouco em PHP, C e Java...

Estou tentando fazer a instalação do python e django no meu notebook mas estou tendo vários erros e problemas que não faço idéia de como resolver pois é tudo via terminal...

Primeiramente, como o python já vem pré instalado não segui nenhum procedimento para instalar o mesmo.

Solicitaram a instalaram de vários packages via terminal, como pip, virtualenv, setuptools/distribute.

Consegui instalar o django (versão 1.3), mas não consigo fazer upgrade devido a problemas com permissão.

Todos os problemas que estou obtendo estão girando em torno disto, visto que não sei absolutamente nada de terminal, está complicado para fazer o Django funcionar perfeitamente... Queria desinstalar tudo e começar do zero liberando todas estas permissões. Algumas coisas tenho colocado o comando "sudo" no terminal e mesmo assim dá problema com a permissão...

Alguém já teve este problema ou poderia me ajudar?

Abaixo estou inserindo alguns problemas que o terminal tem me retornado.

MacBook-Pro-de-Daniel:~ danieloliveira$ pip install Django --upgrade
Downloading/unpacking Django from http://pypi.python.org/packages/source/D/Django/Django-1.4.1.tar.gz#md5=e345268dacff12876ae4e45de0a61b7d
  Downloading Django-1.4.1.tar.gz (7.7Mb): 7.7Mb downloaded
  Running setup.py egg_info for package Django
    
Installing collected packages: Django
  Found existing installation: Django 1.3
    Uninstalling Django:
Exception:
Traceback (most recent call last):
  File "/Library/Python/2.7/site-packages/pip-1.1-py2.7.egg/pip/basecommand.py", line 104, in main
    status = self.run(options, args)
  File "/Library/Python/2.7/site-packages/pip-1.1-py2.7.egg/pip/commands/install.py", line 250, in run
    requirement_set.install(install_options, global_options)
  File "/Library/Python/2.7/site-packages/pip-1.1-py2.7.egg/pip/req.py", line 1129, in install
    requirement.uninstall(auto_confirm=True)
  File "/Library/Python/2.7/site-packages/pip-1.1-py2.7.egg/pip/req.py", line 486, in uninstall
    paths_to_remove.remove(auto_confirm)
  File "/Library/Python/2.7/site-packages/pip-1.1-py2.7.egg/pip/req.py", line 1431, in remove
    renames(path, new_path)
  File "/Library/Python/2.7/site-packages/pip-1.1-py2.7.egg/pip/util.py", line 263, in renames
    shutil.move(old, new)
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/shutil.py", line 299, in move
OSError: [Errno 13] Permission denied: '/Library/Python/2.7/site-packages/Django-1.3-py2.7.egg-info'

Storing complete log in /Users/danieloliveira/Library/Logs/pip.log
MacBook-Pro-de-Daniel:guidez danieloliveira$ python manage.py runserver
Validating models...

Unhandled exception in thread started by <bound method Command.inner_run of <django.contrib.staticfiles.management.commands.runserver.Command object at 0x1103ab410>>
Traceback (most recent call last):
  File "/Library/Python/2.7/site-packages/django/core/management/commands/runserver.py", line 88, in inner_run
    self.validate(display_num_errors=True)
  File "/Library/Python/2.7/site-packages/django/core/management/base.py", line 243, in validate
    from django.core.management.validation import get_validation_errors
  File "/Library/Python/2.7/site-packages/django/core/management/validation.py", line 3, in <module>
    from django.contrib.contenttypes.generic import GenericForeignKey, GenericRelation
  File "/Library/Python/2.7/site-packages/django/contrib/contenttypes/generic.py", line 6, in <module>
    from django.db import connection
  File "/Library/Python/2.7/site-packages/django/db/__init__.py", line 78, in <module>
    connection = connections[DEFAULT_DB_ALIAS]
  File "/Library/Python/2.7/site-packages/django/db/utils.py", line 93, in __getitem__
    backend = load_backend(db['ENGINE'])
  File "/Library/Python/2.7/site-packages/django/db/utils.py", line 33, in load_backend
    return import_module('.base', backend_name)
  File "/Library/Python/2.7/site-packages/django/utils/importlib.py", line 35, in import_module
    __import__(name)
  File "/Library/Python/2.7/site-packages/django/db/backends/mysql/base.py", line 14, in <module>
    raise ImproperlyConfigured("Error loading MySQLdb module: %s" % e)
django.core.exceptions.ImproperlyConfigured: Error loading MySQLdb module: No module named MySQLdb

Edited by Ollie
Link to comment
Share on other sites

0 answers to this question

Recommended Posts

There have been no answers to this question yet

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share



  • Forum Statistics

    • Total Topics
      150.9k
    • Total Posts
      648.7k
×
×
  • Create New...