0
votes

I am trying to fix this but I can't understand why it asks me for a 'username' and 'user id'.

What user name
username: 

What is the user id
Enter user id: 

Can anyone run it without problems?

#!/usr/bin/env python

import numpy as np
import matplotlib.pyplot as plt

N = 5

mMeans = (20, 35, 30, 35, 27)
wMeans = (25, 32, 34, 20, 25)
ind = np.arange(N)
width = 0.5

plt.bar(ind, mMeans, width)
plt.bar(ind, wMeans, width, bottom=mMeans)
plt.show()

This is what appears when I abort the run (Ctrl + c):

$ python stack.py 

    What username
    username:

Here is where I stopped the command.

^CTraceback (most recent call last):
          File "stack.py", line 5, in <module>
            import matplotlib.pyplot as plt

What appears including using IDLE

What user name

username: ^CTraceback (most recent call last):

  File "stack.py", line 4, in 

    from matplotlib import pyplot as plt #.pyplot as plt

  File "/usr/local/lib/python2.7/dist-packages/matplotlib/pyplot.py", line 36, in 

    from matplotlib.backend_bases import FigureCanvasBase

  File "/usr/local/lib/python2.7/dist-packages/matplotlib/backend_bases.py", line 70, in 

    from PIL import Image

  File "/usr/lib/python2.7/dist-packages/PIL/Image.py", line 107, in 
    import builtins

  File "/usr/local/lib/python2.7/dist-packages/builtins/__init__.py", line 8, in 

    from future.builtins import *

  File "/usr/local/lib/python2.7/dist-packages/future/builtins/__init__.py", line 10, in 

    from future.builtins.iterators import (filter, map, zip)

  File "/usr/local/lib/python2.7/dist-packages/future/builtins/iterators.py", line 43, in 

    from future.types import newrange as range

  File "/usr/local/lib/python2.7/dist-packages/future/types/__init__.py", line 243, in 

    from .newrange import newrange

  File "/usr/local/lib/python2.7/dist-packages/future/types/newrange.py", line 25, in 

    from future.backports.misc import count   # with step parameter on Py2.6
  File "/usr/local/lib/python2.7/dist-packages/future/backports/__init__.py", line 17, in 

    from .misc import (ceil,

  File "/usr/local/lib/python2.7/dist-packages/future/backports/misc.py", line 17, in 

    import subprocess

  File "/home/flira/Downloads/subprocess.py", line 6, in 

    username = str(raw_input('username: '))

KeyboardInterrupt
1
I can run the 2nd block of code if I change menMeans and womenMeans to mMeans and hMeans. I'm not sure why pandas is involved according to you.... - ViG
when you run the above script it asks for username? - Arpit Solanki
I don't see any pandas import here but someone sure meddled with source code of your modules as the prompt questions are grammatically incorrect :) - zipa
Ok, there are mistakes in the posted code, now fixed, but it still ask me for username. I have no idea why - F.Lira
What line results in the requests for an username ? Is is really one of the import statements ? Can you try a simple print statement - Alex

1 Answers

1
votes

You have a faulty/personal version of subprocess in your PYTHONPATH.

username = str(raw_input('username: '))

does not exist in any python distribution of subprocess.py I'm familiar with. Delete/rename that file, or better yet, remove

/home/flira/Downloads/

from your PYTHONPATH. The way to install any library is through apt-get, not by downloading it manually (if you're not sure of what you're doing).

Further investigation

I now noticed your terminal screenshot - you're running from Downloads, hence the file is in you path. Get rid of it.