Python3 permissions and installing ipython/jupyter extensions

My question is two-fold, but I believe they are related:

  1. I have recently realized that I have a permission issue with my python3 installation. If I run python3, I cannot import any packages. However, if I run sudo python3, all packages import flawlessly. Similarly, I must run jupyter notebooks with sudo as well. From reading, I believe I have made an error by installing many packages with sudo pip. Is there a straightforward way to fix this?

  2. I am trying to install ipython extensions without luck. Using sudo pip install https://github.com/ipython-contrib/IPython-notebook-extensions/archive/master.zip --user I receive an error error: command 'x86_64-linux-gnu-gcc' failed with exit status 1.

If I download the zip file, and run sudo python3 setup.py install, the error is: IPython-notebook-extensions/configure_nbextensions.py", line 80, in <module> except (psutil.ZombieProcess, psutil.AccessDenied): AttributeError: 'module' object has no attribute 'ZombieProcess'

If I run python setup.py install, the resulting error is:

File "/usr/lib/python2.7/dist-packages/copyreg/__init__.py", line 7, in <module> raise ImportError('This package should not be accessible on Python 3. ' ImportError: This package should not be accessible on Python 3. Either you are trying to run from the python-future src folder or your installation of python-future is corrupted.

This is the same error that I get when importing a package from python (when opened with python, rather than sudo python) in the terminal.

I am using Ubuntu 14.04.

Answers


except (psutil.ZombieProcess, psutil.AccessDenied): AttributeError: 'module' object has no attribute 'ZombieProcess'

From the message,The old version of psutil is missing these module. you should update the package of psutil use:

sudo pip3 install --upgrade psutil

Need Your Help

How to center inline blocks together with text vertically without space at bottom?

css whitespace vertical-alignment

I want to align all elements vertically centered, and using exactly 50px of height, but somehow I have 2 problems:

Bluetooth/Wifi small network

android android-hardware

I want to make an app that connects to devices in the near vecinity and exchanges data.