Installing Pronterface on Ubuntu and the error: Not a directory: ‘/usr/share/printrun/pronterface.py’

Hello, people! Installing PRONTERFACE on my machine, when I tried to run it, I got the error Not a directory: ‘/usr/share/printrun/pronterface.py’. So I’ve created my workaround 😀 I decided to write a small step-by-step to explain how to install this software through the available repository and also solve this error. Let’s go. Open a terminal, and get it done:

sudo apt-get install python python-serial python-wxgtk2.8 python-tk
sudo apt-add-repository ppa:richi-paraeasy/ppa
sudo apt-get update
sudo apt-get install pronterface skeinforge

After running these commands, you’re going to have Pronterface installed. Open the terminal again e try to execute the command “$ pronterface” (whithout the $). You’ll probably get the following error:

OSError: [Errno 20] Not a directory: ‘/usr/share/printrun/pronterface.py’

Ok. Once this happened, let’s go to the next steps. You will edit the files pronterface.py and pronsole.py. You’ll find them at the directory /usr/share/printrun/.

Open each file, as a superuser, with your favorite text editor (like Vim).

If you use gedit, as a text editor, you can execute:

sudo gedit /usr/share/printrun/pronterface.py

Inside the file, look for this line (it should be next to 24):

os.chdir(os.path.realpath(__file__))

And replace for this one:

os.chdir(os.path.realpath(‘./’))

Save and close the file. Next, open the second file:

sudo gedit /usr/share/printrun/pronsole.py

And make the same change in the same line (it should be next to 30, on this file). Then, save and close the file. You have to make this change in both pronterface.py e pronsole.py. Actually, all you are going to do is replace  __file__  for ‘./’  on these lines.

Once you’ve done that, you can run pronterface:

pronterface

If necessary, as superuser:

sudo pronterface

And happy printing!  😀

pronter

 

Anúncios

Uma resposta

  1. Laurent Rouchairoles | Responder

    Please change your line os.chdir(os.path.realpath(‘./’)) as os.chdir(os.path.realpath(‘./’)) it is the non official quotation mark that do create a python error. Well I still have “a Can’t load image from file ‘P-face.ico’: file does not exist. ” when I load pronterface.

    Por favor, altere sua linha os.chdir(os.path.realpath(‘./’)) en os.chdir(os.path.realpath(‘./’))
    t é a aspa não oficial que criar um erro de python. Bem, eu ainda tenho “Can’t load image from file ‘P-face.ico’: file does not exist.”

Deixe um comentário

Preencha os seus dados abaixo ou clique em um ícone para log in:

Logotipo do WordPress.com

Você está comentando utilizando sua conta WordPress.com. Sair / Alterar )

Imagem do Twitter

Você está comentando utilizando sua conta Twitter. Sair / Alterar )

Foto do Facebook

Você está comentando utilizando sua conta Facebook. Sair / Alterar )

Foto do Google+

Você está comentando utilizando sua conta Google+. Sair / Alterar )

Conectando a %s

%d blogueiros gostam disto: