question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

lock command fail with "TypeError: 'NoneType' object has no attribute '__getitem__'"

See original GitHub issue

Hi,

I’m just installed pipenv today and I’m also new to python so, this may be a dumb error from my side.

Every time I’m trying to create a Pipfile.lock with pipenv lock it crashes. This is the full output:

➜  pipenvTest pipenv --version
pipenv, version 3.2.5
➜  pipenvTest pipenv --three
Creating a Pipfile for this project...
Creating a virtualenv for this project...
Running virtualenv with interpreter /usr/local/bin/python3
Using base prefix '/usr/local/Cellar/python3/3.6.0/Frameworks/Python.framework/Versions/3.6'
New python executable in /Users/brunoberisso/Documents/Tryolabs/pipenvTest/.venv/bin/python3.6
Also creating executable in /Users/brunoberisso/Documents/Tryolabs/pipenvTest/.venv/bin/python
Installing setuptools, pip, wheel...done.

Virtualenv location: /Users/brunoberisso/Documents/Tryolabs/pipenvTest/.venv
➜  pipenvTest pipenv install django
Installing Django...
Collecting Django
  Using cached Django-1.10.5-py2.py3-none-any.whl
Installing collected packages: Django
Successfully installed Django-1.10.5

Adding Django to Pipfile's [packages]...
➜  pipenvTest pipenv install scrapy
Installing Scrapy...
Collecting Scrapy
  Using cached Scrapy-1.3.0-py2.py3-none-any.whl
[quite log list of packages here]
Adding Scrapy to Pipfile's [packages]...
➜  pipenvTest pipenv lock
Locking [dev-packages] dependencies...
Locking [packages] dependencies...
Traceback (most recent call last):
  File "/usr/local/bin/pipenv", line 11, in <module>
    sys.exit(cli())
  File "/usr/local/lib/python2.7/site-packages/click/core.py", line 722, in __call__
    return self.main(*args, **kwargs)
  File "/usr/local/lib/python2.7/site-packages/click/core.py", line 697, in main
    rv = self.invoke(ctx)
  File "/usr/local/lib/python2.7/site-packages/click/core.py", line 1066, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/usr/local/lib/python2.7/site-packages/click/core.py", line 895, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/usr/local/lib/python2.7/site-packages/click/core.py", line 535, in invoke
    return callback(*args, **kwargs)
  File "/usr/local/lib/python2.7/site-packages/pipenv/cli.py", line 715, in lock
    do_lock()
  File "/usr/local/lib/python2.7/site-packages/pipenv/cli.py", line 341, in do_lock
    results = get_downloads_info()
  File "/usr/local/lib/python2.7/site-packages/pipenv/cli.py", line 298, in get_downloads_info
    name, version = parse_download_fname(fname)
  File "/usr/local/lib/python2.7/site-packages/pipenv/cli.py", line 279, in parse_download_fname
    name = r['name']
TypeError: 'NoneType' object has no attribute '__getitem__'
➜  pipenvTest

This was also happening with the 3.2.4 version. Thanks in advance

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Comments:5 (3 by maintainers)

github_iconTop GitHub Comments

5reactions
eleijonmarckcommented, Oct 28, 2017

@techalchemy Thanks for the quick answer. It was actually a encoding problem in the background. Had to add

export LC_ALL=en_US.UTF-8
export LANG=en_US.UTF-8

To my shell and then it worked

1reaction
techalchemycommented, Oct 28, 2017

@eleijonmarck it looks like you have pyenv installed but as the warning says you don’t have PYENV_ROOT set. You need to set that environment variable. Based on the fact you have pyenv installed but pip and pipenv are still coming from /usr/local/bin I’m guessing you don’t have the pyenv shims directory on your path either. You will need to add that to your path to use pyenv.

Read more comments on GitHub >

github_iconTop Results From Across the Web

TypeError: 'NoneType' object has no attribute '__getitem__'
The error means you tried to do something like None[5] . In the backtrace, it says self.imageDef=self.values[2] , which means that your self.values...
Read more >
TypeError: 'NoneType' object has no attribute '__getitem__ ...
During a vagrant provisioning, pipenv recently started to fail at creating the Pipfile, Pipfile.lock files and install the packages.
Read more >
TypeError: 'NoneType' .. no attribute '__getitem__' - Anvil Works
I'm getting strange TypeError: 'NoneType' object has no attribute '__getitem__' error . Interestingly, the data gets printed out, like:
Read more >
TypeError: 'NoneType' object has no attribute '__getitem__' in ...
The error means we tried to do something like None[0]. In the backtrace, it says return cursor. fetchone()[0], which means that your cursor....
Read more >
AttributeError: 'NoneType' object has no attribute 'shape'
When I ran the below code, I got the attribute error: 'NoneType' object has no attribute 'shape'. Any idea what I did wrong?...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found