pip unable to install any package and terminal broken - python

I tried to install a python package "BeautifulSoup" and it gave a error message: "pkg_resources.DistributionNotFound". After going through stackoverflow website I download a python script and ran it:
https://svn.apache.org/repos/asf/oodt/tools/oodtsite.publisher/trunk/distribute_setup.py
Now it is throwing a new error message when I try to install sudo pip install beautifulsoup4:
Traceback (most recent call last):
File "/usr/bin/pip", line 5, in <module>
from pkg_resources import load_entry_point
File "/usr/local/lib/python3.4/dist-packages/pkg_resources.py", line 45
def _bypass_ensure_directory(name, mode=0777):
SyntaxError: invalid token
Another interesting thing is when a type a wrong command in terminal like "lss" or anything error message is like this appear:
Traceback (most recent call last):
File "/usr/lib/command-not-found", line 8, in <module>
import CommandNotFound
File "/usr/share/command-not-found/CommandNotFound/__init__.py", line 1, in <module>
from CommandNotFound import CommandNotFound
File "/usr/share/command-not-found/CommandNotFound/CommandNotFound.py", line 13
except gdbm.error, err:
SyntaxError: invalid syntax
Could someone guide me in how to resolve this? My system:
kernel: 3.16.0-4-amd64 x86_64 (64 bit)
desktop: MATE 1.10.0
distro: LinuxMint 2 betsy
Solution
Changed the symblic link "python" in /usr/bin to point at "/usr/bin/python3.4" to "/usr/bin/python2.7".
Other thing is "mintMenu" the advanced start menu in the panel is now working again.

Related

Unable to install packages PyCharm

I am trying to install packages with PyCharm but each time I try to do so it gives me an error:
The full command output:
Traceback (most recent call last):
File "C:\Program Files\JetBrains\PyCharm Community Edition 2017.3.2\helpers\packaging_tool.py", line 2, in <module>
import traceback
ModuleNotFoundError: No module named 'traceback'
What would be a way to fix this?
Edit: I am trying to install the "Python packaging tools" which results in that error.
Try to reset from the right hand side at the top of the window of the Interpreter and try to install again

How to install pydelicious?

Im using on my windows python 3.3.2 I have a problem to instal pydelicious API. I was trying to make it work for a whole week but I couldnt make it happen.
This is my problem:
C:\Users\bartl\Desktop\python-delicious-master>python setup.py install
Traceback (most recent call last):
File "setup.py", line 11, in <module>
import pydelicious
File "C:\Users\bartl\Desktop\python-delicious-master\pydelicious\__init__.py", line 171
raise DeliciousItemExistsError, params['url']
^
SyntaxError: invalid syntax
Can somebody help me?
Replace the __init__.py in the python-delicious-master/pydelicious/.
Here is the link for __init__.py, https://github.com/pcao10/pydelicious/issues/43
It works for me!

Install packages failed: Error occurred when installing package beautifulsoup4?

Why can't I install packages in my PyCharm?I remember that i can install some packages a couple of days ago...
Detail:
The error output of the command:
Traceback (most recent call last):
File "E:\PyCharm 3.4.1\helpers\packaging_tool.py", line 125, in main
retcode = do_install(pkgs)
File "E:\PyCharm 3.4.1\helpers\packaging_tool.py", line 56, in do_install
import pip
File "E:\python\lib\site-packages\pip\__init__.py", line 4, in <module>
import logging
File "E:\python\lib\logging\__init__.py", line 26, in <module>
import sys, os, time, cStringIO, traceback, warnings, weakref, collections
File "E:\python\lib\collections\__init__.py", line 50
self, *args = args
^
SyntaxError: invalid syntax
This is likely because you're using a very old version of PyCharm that was buggy. You're currently using 3.4.1 (as shown in your error log), when you should actually be using 4.5.3.

Error when building a project

I cloned an organism project from github.
I tried to install it, but there is no one setup.py file and no documentation.
Could you advise me how to correctly build and install it under Ubuntu 12.04?
I tried so far:
sudo python3 organism.setup.py install
which shows error message:
byte-compiling /usr/local/lib/python3.2/site-packages/organism/coreaux/configuration.py to configuration.pyc
File "/usr/local/lib/python3.2/site-packages/organism/coreaux/configuration.py", line 31
_USER_FOLDER_PERMISSIONS = 0750
^
SyntaxError: invalid token
and running it shows this error message:
$ organism
Traceback (most recent call last):
File "/usr/local/bin/organism", line 23, in <module>
organism.main()
File "/usr/local/lib/python3.2/site-packages/organism/__init__.py", line 21, in main
import coreaux
ImportError: No module named coreaux
I'm not sure if I should use all the files organism-development.setup.py, organism-organizer.setup.py, organism.setup.py, organism-tk.setup.py in the build process or the error is elsewhere.

Error installing selenium python

Getting this error when running pip install -U selenium. Mid way through the script, it gets the following SyntaxError:
Traceback (most recent call last):
File "<string>", line 14, in <module>
File "C:\Python32\Scripts\build\rdflib\setup.py", line 6, in <module>
from rdflib import __version__
File "rdflib\__init__.py", line 64, in <module>
from rdflib.term import URIRef, BNode, Literal, Variable
File "rdflib\term.py", line 367
except TypeError, te:
^
SyntaxError: invalid syntax
Complete output from command python setup.py egg_info:
Traceback (most recent call last):
File "<string>", line 14, in <module>
File "C:\Python32\Scripts\build\rdflib\setup.py", line 6, in <module>
from rdflib import __version__
File "rdflib\__init__.py", line 64, in <module>
from rdflib.term import URIRef, BNode, Literal, Variable
File "rdflib\term.py", line 367
except TypeError, te:
^
SyntaxError: invalid syntax
----------------------------------------
Command python setup.py egg_info failed with error code 1
Since it is a Syntax Error, I assume it is a python version problem, I'm running 3.2.2.
Pip did come with a pip-3.2.exe file, which I tried to run. But I got the same error. I'm pretty new to Python so it might be something simple.
And how can it be a syntaxError? pip is an already made program.
Running Win7, Python 3.2.2
Selenium does not support Python 3. Use Python 2.7 instead.
Sadly, almost all Python software requires Python 2.x.
[Update]
Selenium supports Python 3.x now.

Categories

Resources