Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

pip install fail #65

Closed
GaryGapinski opened this issue Feb 14, 2018 · 9 comments
Closed

pip install fail #65

GaryGapinski opened this issue Feb 14, 2018 · 9 comments

Comments

@GaryGapinski
Copy link

This was on a newly installed Ubuntu Server 18.04 (daily) instance.

Is this an error in the installer or the environment?

gapinski@tls:~$ sudo apt install python-pip
…
gapinski@tls:~$ pip install trustymail
Collecting trustymail
  Downloading trustymail-0.3.0.tar.gz
Collecting dnspython (from trustymail)
  Downloading dnspython-1.15.0-py2.py3-none-any.whl (177kB)
    100% |████████████████████████████████| 184kB 359kB/s 
Collecting docopt (from trustymail)
  Downloading docopt-0.6.2.tar.gz
Collecting publicsuffix (from trustymail)
  Downloading publicsuffix-1.1.0.tar.gz (61kB)
    100% |████████████████████████████████| 71kB 533kB/s 
Collecting py3dns (from trustymail)
  Downloading py3dns-3.1.0.tar.gz
    Complete output from command python setup.py egg_info:
    Traceback (most recent call last):
      File "<string>", line 1, in <module>
      File "/tmp/pip-build-_LG1bk/py3dns/setup.py", line 7, in <module>
        import DNS
      File "/tmp/pip-build-_LG1bk/py3dns/DNS/__init__.py", line 27, in <module>
        from .Base import DnsRequest
      File "/tmp/pip-build-_LG1bk/py3dns/DNS/Base.py", line 9
    SyntaxError: Non-ASCII character '\xc2' in file /tmp/pip-build-_LG1bk/py3dns/DNS/Base.py on line 10, but no encoding declared; see http://python.org/dev/peps/pep-0263/ for details
    
    ----------------------------------------
Command "python setup.py egg_info" failed with error code 1 in /tmp/pip-build-_LG1bk/py3dns/
gapinski@tls:~$ 

Apologies if this is a dumb question.

@jsf9k
Copy link
Member

jsf9k commented Feb 14, 2018

@GaryGapinski, could you try

pip install git+https://github.com/dhs-ncats/trustymail.git@develop

This will install the latest trustymail from GitHub, which may not have the error. I don't think we have pushed a new release to PyPI in a while.

@GaryGapinski
Copy link
Author

The same error occurs.

root@ubuntu:~# pip install git+https://github.com/dhs-ncats/trustymail.git@develop
Collecting git+https://github.com/dhs-ncats/trustymail.git@develop
  Cloning https://github.com/dhs-ncats/trustymail.git (to develop) to /tmp/pip-YFIi9d-build
Collecting dnspython (from trustymail==0.5.4.dev0)
  Downloading dnspython-1.15.0-py2.py3-none-any.whl (177kB)
    100% |████████████████████████████████| 184kB 1.8MB/s 
Collecting docopt (from trustymail==0.5.4.dev0)
  Downloading docopt-0.6.2.tar.gz
Collecting publicsuffix (from trustymail==0.5.4.dev0)
  Downloading publicsuffix-1.1.0.tar.gz (61kB)
    100% |████████████████████████████████| 71kB 12.1MB/s 
Collecting py3dns (from trustymail==0.5.4.dev0)
  Downloading py3dns-3.1.0.tar.gz
    Complete output from command python setup.py egg_info:
    Traceback (most recent call last):
      File "<string>", line 1, in <module>
      File "/tmp/pip-build-nS_CmP/py3dns/setup.py", line 7, in <module>
        import DNS
      File "/tmp/pip-build-nS_CmP/py3dns/DNS/__init__.py", line 27, in <module>
        from .Base import DnsRequest
      File "/tmp/pip-build-nS_CmP/py3dns/DNS/Base.py", line 9
    SyntaxError: Non-ASCII character '\xc2' in file /tmp/pip-build-nS_CmP/py3dns/DNS/Base.py on line 10, but no encoding declared; see http://python.org/dev/peps/pep-0263/ for details
    
    ----------------------------------------
Command "python setup.py egg_info" failed with error code 1 in /tmp/pip-build-nS_CmP/py3dns/
root@ubuntu:~#

@jsf9k
Copy link
Member

jsf9k commented Feb 27, 2018

@GaryGapinski First of all, apologies for the late response. I was on travel for work last week.

Interestingly, I don't see this behavior. It looks like pip is choking on the copyright symbol in the comment in line 9 of py3dns/DNS/Base.py. I'm guessing this is because your default encoding is set to ascii. Can you check this? Here's what I see on my local system:

$ python
Python 3.6.4 (default, Jan  5 2018, 02:35:40) 
[GCC 7.2.1 20171224] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import sys
>>> sys.getdefaultencoding()
'utf-8'

Let me know what your output looks like and we'll go from there.

@jsf9k
Copy link
Member

jsf9k commented Mar 7, 2018

@GaryGapinski A colleague of mine ran into this very issue. She found that the problem was due to using the python 2 version of pip instead of the python 3 version of pip on Ubuntu. After that it worked.

Can you try installing the python3-pip and use pip3 instead of pip on Ubuntu?

@GaryGapinski
Copy link
Author

Apologies. I missed the earlier query.

I'll try these this evening (on a clean Ubuntu 18.04 with Python 3).

@jsf9k
Copy link
Member

jsf9k commented Mar 7, 2018

No worries, @GaryGapinski! I hope this fixes your issue. 🤞

@GaryGapinski
Copy link
Author

pip3 install works correcyly. I started with Ubuntu 18.04 daily and added pip3-python (thus its dependencies) and git.

gapinski@ubuntu:~$ pip3 install git+https://github.com/dhs-ncats/trustymail.git@develop
Collecting git+https://github.com/dhs-ncats/trustymail.git@develop
  Cloning https://github.com/dhs-ncats/trustymail.git (to develop) to /tmp/pip-x321s86i-build
Collecting dnspython (from trustymail==0.5.4.dev0)
  Downloading dnspython-1.15.0-py2.py3-none-any.whl (177kB)
    100% |████████████████████████████████| 184kB 2.1MB/s 
Collecting docopt (from trustymail==0.5.4.dev0)
  Downloading docopt-0.6.2.tar.gz
Collecting publicsuffix (from trustymail==0.5.4.dev0)
  Downloading publicsuffix-1.1.0.tar.gz (61kB)
    100% |████████████████████████████████| 71kB 4.8MB/s 
Collecting py3dns (from trustymail==0.5.4.dev0)
  Downloading py3dns-3.1.0.tar.gz
Collecting pyspf==2.0.11 (from trustymail==0.5.4.dev0)
  Downloading pyspf-2.0.11.tar.gz (63kB)
    100% |████████████████████████████████| 71kB 4.6MB/s 
Collecting requests (from trustymail==0.5.4.dev0)
  Downloading requests-2.18.4-py2.py3-none-any.whl (88kB)
    100% |████████████████████████████████| 92kB 7.3MB/s 
Collecting idna<2.7,>=2.5 (from requests->trustymail==0.5.4.dev0)
  Downloading idna-2.6-py2.py3-none-any.whl (56kB)
    100% |████████████████████████████████| 61kB 7.2MB/s 
Collecting urllib3<1.23,>=1.21.1 (from requests->trustymail==0.5.4.dev0)
  Downloading urllib3-1.22-py2.py3-none-any.whl (132kB)
    100% |████████████████████████████████| 133kB 4.3MB/s 
Collecting chardet<3.1.0,>=3.0.2 (from requests->trustymail==0.5.4.dev0)
  Downloading chardet-3.0.4-py2.py3-none-any.whl (133kB)
    100% |████████████████████████████████| 143kB 5.1MB/s 
Collecting certifi>=2017.4.17 (from requests->trustymail==0.5.4.dev0)
  Downloading certifi-2018.1.18-py2.py3-none-any.whl (151kB)
    100% |████████████████████████████████| 153kB 3.0MB/s 
Building wheels for collected packages: docopt, publicsuffix, py3dns, pyspf
  Running setup.py bdist_wheel for docopt ... done
  Stored in directory: /home/gapinski/.cache/pip/wheels/b2/16/5f/c33a2bb5f2dce71205f8e65cbfd05647d79d441282be31fd82
  Running setup.py bdist_wheel for publicsuffix ... done
  Stored in directory: /home/gapinski/.cache/pip/wheels/77/dc/58/b99f96cbf77ee8183448b897a1daed82141ce346ef98752895
  Running setup.py bdist_wheel for py3dns ... done
  Stored in directory: /home/gapinski/.cache/pip/wheels/0e/cd/13/3d1904837de289d55e0729d8dd33533dab99c92a54e7a03319
  Running setup.py bdist_wheel for pyspf ... done
  Stored in directory: /home/gapinski/.cache/pip/wheels/ea/75/dc/b0c35863cb51ce7c853b2156eef1ebd7aa58615fbd664ac654
Successfully built docopt publicsuffix py3dns pyspf
Installing collected packages: dnspython, docopt, publicsuffix, py3dns, pyspf, idna, urllib3, chardet, certifi, requests, trustymail
  Running setup.py install for trustymail ... done
Successfully installed certifi-2018.1.18 chardet-3.0.4 dnspython-1.15.0 docopt-0.6.2 idna-2.6 publicsuffix-1.1.0 py3dns-3.1.0 pyspf-2.0.11 requests-2.18.4 trustymail-0.5.4.dev0 urllib3-1.22
gapinski@ubuntu:~$```

@jsf9k
Copy link
Member

jsf9k commented Mar 10, 2018

That's great to hear!

@refayathaque
Copy link

Hi guys, my problem is related to Gary's above so posting here.

We are trying to create an AWS Lambda function that utilizes pshtt. We are using a Docker container (amazonlinux) to get the AWS specific binaries (.so files) we need for the Lambda deployment package. [ We tried this using an Ubuntu container but Lambda wasn't working, and for this we were referencing this article on Medium ]

In our amazonlinux container we are running python 3.6.5 on virtualenv, and are unable to pip install pshtt. We have the latest versions of the pip packages pip10.0.1, setuptools39.1.0, and wheel0.31.0, however when we try doing pip install pshtt we come across this error when pip is collecting publicsuffix - Command "python setup.py egg_info" failed with error code 1 in /tmp/pip-install-7aa4sbyv/publicsuffix/

We looked into this and a lot of people say that you have to upgrade the setuptools package, and we did.

Any help is greatly appreciated. 🙏

mcdonnnj added a commit that referenced this issue Jan 23, 2023
Use the --strict Flag for the yamllint pre-commit Hook
mcdonnnj added a commit that referenced this issue Jan 23, 2023
…rements

Add the mypy Package to the Development Package Requirements
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants