CSSE1001 / MyPyTutor

Interactive tutorial application for Python3.
Other
7 stars 12 forks source link

Keyring module on Windows Failing #124

Closed mijohen closed 9 years ago

mijohen commented 9 years ago
We can securely store your username and password using the keyring module
Install keyring module [yN]: y
Traceback (most recent call last):
  File "C:\Users\Michael\Documents\MyPyTutorInstall\MyPyTutor.py", line 400, in try_get_credentials
    import keyring
ImportError: No module named 'keyring'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "C:\Users\Michael\Documents\MyPyTutorInstall\MyPyTutor.py", line 601, in <module>
    sys.exit(main())
  File "C:\Users\Michael\Documents\MyPyTutorInstall\MyPyTutor.py", line 585, in main
    username, password = try_get_credentials()
  File "C:\Users\Michael\Documents\MyPyTutorInstall\MyPyTutor.py", line 416, in try_get_credentials
    if not install_keyring_module():
  File "C:\Users\Michael\Documents\MyPyTutorInstall\MyPyTutor.py", line 364, in install_keyring_module
    import pip
  File "C:\Python34\lib\site-packages\pip\__init__.py", line 9, in <module>
    from pip.log import logger
  File "C:\Python34\lib\site-packages\pip\log.py", line 8, in <module>
    from pip import backwardcompat
  File "C:\Python34\lib\site-packages\pip\backwardcompat\__init__.py", line 27, in <module>
    console_encoding = sys.__stdout__.encoding
AttributeError: 'NoneType' object has no attribute 'encoding'
jgat commented 9 years ago

sys.stdout is None? wut?

sapi commented 9 years ago

Importing pip caused an AttributeError? That is very wtf.

On 26 February 2015 at 21:58, Jackson Gatenby notifications@github.com wrote:

sys.stdout is None? wut?

— Reply to this email directly or view it on GitHub https://github.com/CSSE1001/MyPyTutor/issues/124#issuecomment-76159067.

mijohen commented 9 years ago

Where does it save the configurations? I want to change it so I can test this again because it has saved my choice.

sapi commented 9 years ago

They're in ~/.mptrc. Just clear the whole directory if you want to go again (and make sure that you're running a MyPyTutor.py which is outside the install directory).

mijohen commented 9 years ago

Doesn't mpt_installer place MyPyTutur.py inside the installation folder?

sapi commented 9 years ago

Yeah, both do.

That means if you want to run the new installer (aka, MyPyTutor.py, the one which installs pip), you need to make sure you're running MyPyTutor.py from outside the installed directory (or it will launch the app).

I don't think mpt_installer.py will do anything sane with what I've got on the server atm. Try the new version, maybe? Just copy MyPyTutor.py from the git repo somewhere else, then run it.

mijohen commented 9 years ago

I've been using the installer and it installs fine and runs the app fine. But I'm still getting the above error when I choose 'y'. And I re-installed a fresh copy of python.

mijohen commented 9 years ago

I just saw your instructions on how to use the new installer, ive been using mpt_installer.py which is in the main repo. So this may be why I am getting the above error but I don't have time to check as it is late.

sapi commented 9 years ago

Let me know what happens with the new installer. If you're still getting the error, I'll give this a closer look :)

mijohen commented 9 years ago

I am still getting this error with the new installer on Windows 8.1.

Checking for MyPyTutor updates...done Checking for tutorial package updates...done

We can securely store your username and password using the keyring module Type 'yes' if you would like to install the keyring module: yes Exception: Traceback (most recent call last): File "C:\Users\Michael\Documents\mpt-install\MyPyTutor.py", line 433, in try_get_credentials import keyring ImportError: No module named 'keyring'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "C:\Python34\lib\site-packages\pip\basecommand.py", line 232, in main
    status = self.run(options, args)
  File "C:\Python34\lib\site-packages\pip\commands\install.py", line 339, in run
    requirement_set.prepare_files(finder)
  File "C:\Python34\lib\site-packages\pip\req\req_set.py", line 385, in prepare_files
    req_to_install.run_egg_info()
  File "C:\Python34\lib\site-packages\pip\req\req_install.py", line 358, in run_egg_info
    command_desc='python setup.py egg_info')
  File "C:\Python34\lib\site-packages\pip\utils\__init__.py", line 715, in call_subprocess
    stdout = remove_tracebacks(console_to_str(proc.stdout.read()))
  File "C:\Python34\lib\site-packages\pip\compat\__init__.py", line 34, in console_to_str
    return s.decode(sys.__stdout__.encoding)
AttributeError: 'NoneType' object has no attribute 'encoding'
mijohen commented 9 years ago

This also only occurs when you run the installer through IDLE.

sapi commented 9 years ago

Closing as falling into the category of 'IDLE being funny'. Thanks for the report, though.

jgat commented 9 years ago

Worth double-checking: is it straightforward for students to run the installer outside of IDLE on lab machines/windows and mac laptops/etc?

I seem to remember that the old installer would often need to be run in IDLE, because double-clicking on it in windows wasn't guaranteed to do anything.

sapi commented 9 years ago

Unfortunately we can't test atm: double-clicking on Windows runs Python 2, and it's impossible to change the association (because Windows).

On 2 March 2015 at 11:50, Jackson Gatenby notifications@github.com wrote:

Worth double-checking: is it straightforward for students to run the installer outside of IDLE on lab machines/windows and mac laptops/etc?

I seem to remember that the old installer would often need to be run in IDLE, because double-clicking on it in windows wasn't guaranteed to do anything.

— Reply to this email directly or view it on GitHub https://github.com/CSSE1001/MyPyTutor/issues/124#issuecomment-76647690.

mijohen commented 9 years ago

Is this association being changed on the lab computers before MyPyTutor is released so that students do not run it from within IDLE?

sapi commented 9 years ago

We're trying to (Peter submitted a helpdesk ticket).

If it doesn't come through in time, we can provide a .bat file which executes it using the correct interpreter.

On Monday, March 2, 2015, Michael Henderson notifications@github.com wrote:

Is this association being changed on the lab computers before MyPyTutor is released so that students do not run it from within IDLE?

— Reply to this email directly or view it on GitHub https://github.com/CSSE1001/MyPyTutor/issues/124#issuecomment-76685891.

starsnabove commented 9 years ago

I am going to do a video and other tutorial on "Doing stuff in the lab" maybe that will help avoid the problem On 02/03/2015 8:06 pm, "Michael Henderson" notifications@github.com wrote:

Is this association being changed on the lab computers before MyPyTutor is released so that students do not run it from within IDLE?

— Reply to this email directly or view it on GitHub https://github.com/CSSE1001/MyPyTutor/issues/124#issuecomment-76685891.