Open mingalsuo opened 10 years ago
Me too,help
@mingalsuo was right.
@gclsoft The urlparse
in Python 2.7.11 was renamed to urllib.parse
in Python 3.
So, if you have a code such from urlparse import urljoin
, I suggest you change it to from urllib.parse import urljoin
Same problem:
>>> from gittle import Gittle
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/Users/haidao/.pyenv/versions/miniconda3-latest/lib/python3.5/site-packages/gittle/__init__.py", line 1, in <module>
from . import utils
File "/Users/haidao/.pyenv/versions/miniconda3-latest/lib/python3.5/site-packages/gittle/utils/__init__.py", line 1, in <module>
from . import paths, urls, git
File "/Users/haidao/.pyenv/versions/miniconda3-latest/lib/python3.5/site-packages/gittle/utils/urls.py", line 2, in <module>
from urlparse import urlparse
ImportError: No module named 'urlparse'
And shell works fine.
open terminal nav to project or file dir and
run
$ 2to3 -w projecname/
change the whole project to python3or
$ 2to3 -w file.py
to change only one file
I thought this was an issue because 2to3 didn't fix Urlparse?
On Mon, Nov 21, 2016, 6:18 AM THULEBONA HADEBE notifications@github.com wrote:
open terminal nav to project or file dir and
run $ 2to3 -w projecname/ change the whole project to python3
or $ 2to3 -w file.py to change only one file
— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/FriendCode/gittle/issues/49#issuecomment-261936035, or mute the thread https://github.com/notifications/unsubscribe-auth/AEOlAQmf3FzGo8avOD2fjx1pMEaq6B3gks5rAZorgaJpZM4C2ttn .
2to3 works like a charm for me, haven't faced any problems using it
In that case, this issue should absolutely be closed; it's not a Gittle bug at all.
What if you wanted to install urllib.parse
? I was trying to install this module through windows cmd
and all I get is one error message:
Could not find a version that satisfies the requirement urllib.parse (from versions:)
No matching distribution found for urllib.parse
I tried alternative nomenclature as suggested here: http://python3porting.com/stdlib.html
Sreekrishnadutta, urllib3 has the parse module, for windows cmd:
C:\>pip install urllib3
Collecting urllib3
Using cached urllib3-1.20-py2.py3-none-any.whl
Installing collected packes: urllib3
Successfully installed urllib3-1.20
C:\>python
...
>>>from urllib import parse
Hope that helps
run $ 2to3 -w projecname/ change the whole project to python3 Worked like a charm for me, was struggling with geography project. It solved
Use import urllib.parse as urlparse
Or simply use from urllib.parse import urlparse
Hi!
Apparently Gittle has atleast this one issue with Python 3:
My environment:
According to https://docs.python.org/2/library/urlparse.html: