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

TypeError: string argument expected, got 'NoneType' #124

Closed
stevenlis opened this issue Sep 2, 2018 · 11 comments
Closed

TypeError: string argument expected, got 'NoneType' #124

stevenlis opened this issue Sep 2, 2018 · 11 comments

Comments

@stevenlis
Copy link

stevenlis commented Sep 2, 2018

Trying to install the kernel on Windows 10 and encountered the following issues:

Microsoft Windows [Version 10.0.17134.228]
(c) 2018 Microsoft Corporation. All rights reserved.

C:\Users\liqia>pip install stata_kernel
Collecting stata_kernel
  Using cached https://files.pythonhosted.org/packages/d4/55/39b8359974cc83dd1d4c123a389cef790a5e92c644e45b955ba832f0e815/stata_kernel-1.4.1-py3-none-any.whl
Requirement already satisfied: pygments>=2.2.0 in c:\users\liqia\anaconda3\lib\site-packages (from stata_kernel) (2.2.0)
Requirement already satisfied: pillow>=5.2.0 in c:\users\liqia\anaconda3\lib\site-packages (from stata_kernel) (5.2.0)
Collecting pexpect>=4.6.0 (from stata_kernel)
  Using cached https://files.pythonhosted.org/packages/89/e6/b5a1de8b0cc4e07ca1b305a4fcc3f9806025c1b651ea302646341222f88b/pexpect-4.6.0-py2.py3-none-any.whl
Requirement already satisfied: beautifulsoup4>=4.6.3 in c:\users\liqia\anaconda3\lib\site-packages (from stata_kernel) (4.6.3)
Requirement already satisfied: ipykernel>=4.8.2 in c:\users\liqia\anaconda3\lib\site-packages (from stata_kernel) (4.8.2)
Collecting regex>=2018.7.11 (from stata_kernel)
  Using cached https://files.pythonhosted.org/packages/15/a5/cdb73862c207dcbb2dec5a4c64f850314910c55097dfa12cdfc533892502/regex-2018.08.29-cp36-none-win_amd64.whl
Requirement already satisfied: jupyter-client>=5.2.3 in c:\users\liqia\anaconda3\lib\site-packages (from stata_kernel) (5.2.3)
Requirement already satisfied: pandas>=0.23.4 in c:\users\liqia\anaconda3\lib\site-packages (from stata_kernel) (0.23.4)
Requirement already satisfied: IPython>=6.5.0 in c:\users\liqia\anaconda3\lib\site-packages (from stata_kernel) (6.5.0)
Collecting ptyprocess>=0.5 (from pexpect>=4.6.0->stata_kernel)
  Using cached https://files.pythonhosted.org/packages/d1/29/605c2cc68a9992d18dada28206eeada56ea4bd07a239669da41674648b6f/ptyprocess-0.6.0-py2.py3-none-any.whl
Requirement already satisfied: traitlets>=4.1.0 in c:\users\liqia\anaconda3\lib\site-packages (from ipykernel>=4.8.2->stata_kernel) (4.3.2)
Requirement already satisfied: tornado>=4.0 in c:\users\liqia\anaconda3\lib\site-packages (from ipykernel>=4.8.2->stata_kernel) (5.1)
Requirement already satisfied: jupyter_core in c:\users\liqia\anaconda3\lib\site-packages (from jupyter-client>=5.2.3->stata_kernel) (4.4.0)
Exception:
Traceback (most recent call last):
  File "c:\users\liqia\anaconda3\lib\site-packages\pip\_internal\basecommand.py", line 141, in main
    status = self.run(options, args)
  File "c:\users\liqia\anaconda3\lib\site-packages\pip\_internal\commands\install.py", line 299, in run
    resolver.resolve(requirement_set)
  File "c:\users\liqia\anaconda3\lib\site-packages\pip\_internal\resolve.py", line 102, in resolve
    self._resolve_one(requirement_set, req)
  File "c:\users\liqia\anaconda3\lib\site-packages\pip\_internal\resolve.py", line 261, in _resolve_one
    check_dist_requires_python(dist)
  File "c:\users\liqia\anaconda3\lib\site-packages\pip\_internal\utils\packaging.py", line 46, in check_dist_requires_python
    feed_parser.feed(metadata)
  File "c:\users\liqia\anaconda3\lib\email\feedparser.py", line 175, in feed
    self._input.push(data)
  File "c:\users\liqia\anaconda3\lib\email\feedparser.py", line 103, in push
    self._partial.write(data)
TypeError: string argument expected, got 'NoneType'
@stevenlis
Copy link
Author

I ran the following commond from the doc:

pip install stata_kernel --ignore-install pexpect

Got a highlighted line:

twisted 18.7.0 requires PyHamcrest>=1.9.0, which is not installed.

I ingored it and contiuned the installation step it works in Atom. Btw, should I still install twisted and pyhamcrest?

@kylebarron
Copy link
Owner

I'm not completely sure what the issue is here. It could be an issue with pip itself, but I don't know. It should be working fine after the --ignore-installed pexpect...?

@stevenlis
Copy link
Author

I pip installed PyHamcrest, and also tried pip install twisted , and got the following:

C:\Users\liqia>pip install twisted
Requirement already satisfied: twisted in c:\users\liqia\anaconda3\lib\site-packages (18.7.0)
Requirement already satisfied: zope.interface>=4.4.2 in c:\users\liqia\anaconda3\lib\site-packages (from twisted) (4.5.0)
Requirement already satisfied: constantly>=15.1 in c:\users\liqia\anaconda3\lib\site-packages (from twisted) (15.1.0)
Requirement already satisfied: incremental>=16.10.1 in c:\users\liqia\anaconda3\lib\site-packages (from twisted) (17.5.0)
Requirement already satisfied: Automat>=0.3.0 in c:\users\liqia\anaconda3\lib\site-packages (from twisted) (0.7.0)
Requirement already satisfied: hyperlink>=17.1.1 in c:\users\liqia\anaconda3\lib\site-packages (from twisted) (18.0.0)
Requirement already satisfied: PyHamcrest>=1.9.0 in c:\users\liqia\anaconda3\lib\site-packages (from twisted) (1.9.0)
Requirement already satisfied: attrs>=17.4.0 in c:\users\liqia\anaconda3\lib\site-packages (from twisted) (18.1.0)
Requirement already satisfied: setuptools in c:\users\liqia\anaconda3\lib\site-packages (from zope.interface>=4.4.2->twisted) (40.2.0)
Requirement already satisfied: six in c:\users\liqia\anaconda3\lib\site-packages (from Automat>=0.3.0->twisted) (1.11.0)
Requirement already satisfied: idna>=2.5 in c:\users\liqia\anaconda3\lib\site-packages (from hyperlink>=17.1.1->twisted) (2.7)

So, I guess it's fine.

@stevenlis
Copy link
Author

@kylebarron I ran into the same issue while trying to pip upgrade the package. What should I do?

C:\Users\liqia>pip install stata_kernel --upgrade
Collecting stata_kernel
  Downloading https://files.pythonhosted.org/packages/1e/49/eebc92f1a61570d4a7cdcabb16893e135f728b8202c30b6e1b359c654610/stata_kernel-1.4.7-py3-none-any.whl
Requirement already satisfied, skipping upgrade: beautifulsoup4>=4.6.3 in c:\users\liqia\anaconda3\lib\site-packages (from stata_kernel) (4.6.3)
Requirement already satisfied, skipping upgrade: pandas>=0.23.4 in c:\users\liqia\anaconda3\lib\site-packages (from stata_kernel) (0.23.4)
Requirement already satisfied, skipping upgrade: pexpect>=4.6.0 in c:\users\liqia\anaconda3\lib\site-packages (from stata_kernel) (4.6.0)
Requirement already satisfied, skipping upgrade: pygments>=2.2.0 in c:\users\liqia\anaconda3\lib\site-packages (from stata_kernel) (2.2.0)
Requirement already satisfied, skipping upgrade: jupyter-client>=5.2.3 in c:\users\liqia\anaconda3\lib\site-packages (from stata_kernel) (5.2.3)
Requirement already satisfied, skipping upgrade: regex>=2018.7.11 in c:\users\liqia\anaconda3\lib\site-packages (from stata_kernel) (2018.8.29)
Requirement already satisfied, skipping upgrade: ipykernel>=4.8.2 in c:\users\liqia\anaconda3\lib\site-packages (from stata_kernel) (4.9.0)
Requirement already satisfied, skipping upgrade: pillow>=5.2.0 in c:\users\liqia\anaconda3\lib\site-packages (from stata_kernel) (5.2.0)
Requirement already satisfied, skipping upgrade: IPython>=6.5.0 in c:\users\liqia\anaconda3\lib\site-packages (from stata_kernel) (6.5.0)
Requirement already satisfied, skipping upgrade: python-dateutil>=2.5.0 in c:\users\liqia\anaconda3\lib\site-packages (from pandas>=0.23.4->stata_kernel) (2.7.3)
Requirement already satisfied, skipping upgrade: pytz>=2011k in c:\users\liqia\anaconda3\lib\site-packages (from pandas>=0.23.4->stata_kernel) (2018.5)
Requirement already satisfied, skipping upgrade: numpy>=1.9.0 in c:\users\liqia\anaconda3\lib\site-packages (from pandas>=0.23.4->stata_kernel) (1.15.1)
Requirement already satisfied, skipping upgrade: ptyprocess>=0.5 in c:\users\liqia\anaconda3\lib\site-packages (from pexpect>=4.6.0->stata_kernel) (0.6.0)
Requirement already satisfied, skipping upgrade: traitlets in c:\users\liqia\anaconda3\lib\site-packages (from jupyter-client>=5.2.3->stata_kernel) (4.3.2)
Requirement already satisfied, skipping upgrade: jupyter_core in c:\users\liqia\anaconda3\lib\site-packages (from jupyter-client>=5.2.3->stata_kernel) (4.4.0)
Exception:
Traceback (most recent call last):
  File "c:\users\liqia\anaconda3\lib\site-packages\pip\_internal\basecommand.py", line 141, in main
    status = self.run(options, args)
  File "c:\users\liqia\anaconda3\lib\site-packages\pip\_internal\commands\install.py", line 299, in run
    resolver.resolve(requirement_set)
  File "c:\users\liqia\anaconda3\lib\site-packages\pip\_internal\resolve.py", line 102, in resolve
    self._resolve_one(requirement_set, req)
  File "c:\users\liqia\anaconda3\lib\site-packages\pip\_internal\resolve.py", line 261, in _resolve_one
    check_dist_requires_python(dist)
  File "c:\users\liqia\anaconda3\lib\site-packages\pip\_internal\utils\packaging.py", line 46, in check_dist_requires_python
    feed_parser.feed(metadata)
  File "c:\users\liqia\anaconda3\lib\email\feedparser.py", line 175, in feed
    self._input.push(data)
  File "c:\users\liqia\anaconda3\lib\email\feedparser.py", line 103, in push
    self._partial.write(data)
TypeError: string argument expected, got 'NoneType'

@kylebarron
Copy link
Owner

Did you try pip install stata_kernel --ignore-install pexpect?

@stevenlis
Copy link
Author

So I just need to overwrite the package for the update? I don't understand why it raises an exception. Btw, is there any way I can know whether I need to upgrade the kernel or not?

@kylebarron
Copy link
Owner

Well pip always overwrites stata_kernel when it updates. What pip version do you have (pip show pip)? If it's not 18.0, you should upgrade (pip install --upgrade pip).

This looks to be this error: pypa/pip#5082.

You can use a third-party service like libraries.io to email you when a new version is released.

@stevenlis
Copy link
Author

I did upgrade pip when I tried to install the kernel in the first place because pip reminded to do so. My pip version is indeed 18.0.

Name: pip
Version: 18.0
Summary: The PyPA recommended tool for installing Python packages.
Home-page: https://pip.pypa.io/
Author: The pip developers
Author-email: [email protected]
License: MIT
Location: c:\users\liqia\anaconda3\lib\site-packages
Requires:
Required-by:

I will try libraries.io. Thanks.

@kylebarron
Copy link
Owner

Ok. Did pip install stata_kernel --ignore-install pexpect work?

@stevenlis
Copy link
Author

Yes, stata-kernel-1.4.7 is installed. I wonder if this will also upgrade numpy, pandas, etc. every time when I upgrade stata_kernel. I wonder if there is a way to upgrade it only.

@kylebarron
Copy link
Owner

You can google but I think you could do pip install stata-kernel==1.4.7 and that would upgrade stata_kernel without upgrading anything else.

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

2 participants