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.

No module named 'past'

See original GitHub issue
  • Cookiecutter version: 1.7.0 (note: running cookiecutter -v doesn’t work)
  • Template project url: https://github.com/napari/cookiecutter-napari-plugin
  • Python version: 3.6.8 (v3.6.8:3c6b436a57, Dec 24 2018, 02:04:31)
  • Operating System: macOS Version 10.15.4 (19E258a)

Description:

The cookiecutter command-line interface does not work due to missing module named past.

What I’ve run:

What I ran:

python3 -m pip install cookiecutter  # successful
cookiecutter https://github.com/napari/cookiecutter-napari-plugin  # failed
cookiecutter -V  # failed
cookiecutter  # failed

All three of the lines that failed had the same error output:

Traceback (most recent call last):
  File "/Library/Frameworks/Python.framework/Versions/3.6/bin/cookiecutter", line 5, in <module>
    from cookiecutter.__main__ import main
  File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/cookiecutter/__main__.py", line 5, in <module>
    from .cli import main
  File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/cookiecutter/cli.py", line 14, in <module>
    from cookiecutter.main import cookiecutter
  File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/cookiecutter/main.py", line 15, in <module>
    from .generate import generate_context, generate_files
  File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/cookiecutter/generate.py", line 27, in <module>
    from .hooks import run_hook
  File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/cookiecutter/hooks.py", line 13, in <module>
    from cookiecutter import utils
  File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/cookiecutter/utils.py", line 14, in <module>
    from .prompt import read_user_yes_no
  File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/cookiecutter/prompt.py", line 9, in <module>
    from past.builtins import basestring
ModuleNotFoundError: No module named 'past'

Running python3 -m pip install past results in:

ERROR: Could not find a version that satisfies the requirement past (from versions: none)
ERROR: No matching distribution found for past

Issue Analytics

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

github_iconTop GitHub Comments

1reaction
ssbarneacommented, Apr 1, 2020

We need to make a new release on cookiecutter, this would solve the issue. Sadly I did not get any feedback yet on https://github.com/cookiecutter/cookiecutter/issues/1337 which blocks me from making a release.

0reactions
insspbcommented, Apr 13, 2020

@ssbarnea @sumanthratna This dependency comes from other packages. Tested today, cannot confirm issue. Closed.

Test log:

insspb@insspb-notebook:~$ cd git
insspb@insspb-notebook:~/git$ mkdir test1328
insspb@insspb-notebook:~/git$ cd test1328/
insspb@insspb-notebook:~/git/test1328$ python3
python3            python3.6          python3.7-config   python3m
python3.4          python3.6-config   python3.7m         python3m-config
python3.4m         python3.6m         python3.7m-config  
python3.5          python3.6m-config  python3.8          
python3.5m         python3.7          python3-config     
insspb@insspb-notebook:~/git/test1328$ python3.6 -m venv .venv
insspb@insspb-notebook:~/git/test1328$ source .venv/
bash: source: .venv/: is a directory
insspb@insspb-notebook:~/git/test1328$ source .venv/bin/activate
(.venv) insspb@insspb-notebook:~/git/test1328$ python3 -m pip install cookiecutter
Collecting cookiecutter
  Using cached https://files.pythonhosted.org/packages/86/c9/7184edfb0e89abedc37211743d1420810f6b49ae4fa695dfc443c273470d/cookiecutter-1.7.0-py2.py3-none-any.whl
Collecting future>=0.15.2 (from cookiecutter)
  Cache entry deserialization failed, entry ignored
Collecting click>=7.0 (from cookiecutter)
  Cache entry deserialization failed, entry ignored
  Cache entry deserialization failed, entry ignored
  Downloading https://files.pythonhosted.org/packages/dd/c0/4d8f43a9b16e289f36478422031b8a63b54b6ac3b1ba605d602f10dd54d6/click-7.1.1-py2.py3-none-any.whl (82kB)
    100% |β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆ| 92kB 1.1MB/s 
Collecting jinja2>=2.7 (from cookiecutter)
  Cache entry deserialization failed, entry ignored
  Using cached https://files.pythonhosted.org/packages/27/24/4f35961e5c669e96f6559760042a55b9bcfcdb82b9bdb3c8753dbe042e35/Jinja2-2.11.1-py2.py3-none-any.whl
Collecting poyo>=0.1.0 (from cookiecutter)
  Cache entry deserialization failed, entry ignored
  Using cached https://files.pythonhosted.org/packages/42/50/0b0820601bde2eda403f47b9a4a1f270098ed0dd4c00c443d883164bdccc/poyo-0.5.0-py2.py3-none-any.whl
Collecting binaryornot>=0.2.0 (from cookiecutter)
  Cache entry deserialization failed, entry ignored
  Using cached https://files.pythonhosted.org/packages/24/7e/f7b6f453e6481d1e233540262ccbfcf89adcd43606f44a028d7f5fae5eb2/binaryornot-0.4.4-py2.py3-none-any.whl
Collecting whichcraft>=0.4.0 (from cookiecutter)
  Cache entry deserialization failed, entry ignored
  Using cached https://files.pythonhosted.org/packages/b5/a2/81887a0dae2e4d2adc70d9a3557fdda969f863ced51cd3c47b587d25bce5/whichcraft-0.6.1-py2.py3-none-any.whl
Collecting jinja2-time>=0.1.0 (from cookiecutter)
  Cache entry deserialization failed, entry ignored
  Using cached https://files.pythonhosted.org/packages/6a/a1/d44fa38306ffa34a7e1af09632b158e13ec89670ce491f8a15af3ebcb4e4/jinja2_time-0.2.0-py2.py3-none-any.whl
Collecting requests>=2.18.0 (from cookiecutter)
  Cache entry deserialization failed, entry ignored
  Cache entry deserialization failed, entry ignored
  Downloading https://files.pythonhosted.org/packages/1a/70/1935c770cb3be6e3a8b78ced23d7e0f3b187f5cbfab4749523ed65d7c9b1/requests-2.23.0-py2.py3-none-any.whl (58kB)
    100% |β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆ| 61kB 7.6MB/s 
Collecting MarkupSafe>=0.23 (from jinja2>=2.7->cookiecutter)
  Cache entry deserialization failed, entry ignored
  Using cached https://files.pythonhosted.org/packages/b2/5f/23e0023be6bb885d00ffbefad2942bc51a620328ee910f64abe5a8d18dd1/MarkupSafe-1.1.1-cp36-cp36m-manylinux1_x86_64.whl
Collecting chardet>=3.0.2 (from binaryornot>=0.2.0->cookiecutter)
  Cache entry deserialization failed, entry ignored
  Using cached https://files.pythonhosted.org/packages/bc/a9/01ffebfb562e4274b6487b4bb1ddec7ca55ec7510b22e4c51f14098443b8/chardet-3.0.4-py2.py3-none-any.whl
Collecting arrow (from jinja2-time>=0.1.0->cookiecutter)
  Cache entry deserialization failed, entry ignored
  Using cached https://files.pythonhosted.org/packages/92/fa/f84896dede5decf284e6922134bf03fd26c90870bbf8015f4e8ee2a07bcc/arrow-0.15.5-py2.py3-none-any.whl
Collecting idna<3,>=2.5 (from requests>=2.18.0->cookiecutter)
  Cache entry deserialization failed, entry ignored
  Cache entry deserialization failed, entry ignored
  Downloading https://files.pythonhosted.org/packages/89/e3/afebe61c546d18fb1709a61bee788254b40e736cff7271c7de5de2dc4128/idna-2.9-py2.py3-none-any.whl (58kB)
    100% |β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆ| 61kB 6.9MB/s 
Collecting certifi>=2017.4.17 (from requests>=2.18.0->cookiecutter)
  Cache entry deserialization failed, entry ignored
  Cache entry deserialization failed, entry ignored
  Downloading https://files.pythonhosted.org/packages/57/2b/26e37a4b034800c960a00c4e1b3d9ca5d7014e983e6e729e33ea2f36426c/certifi-2020.4.5.1-py2.py3-none-any.whl (157kB)
    100% |β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆ| 163kB 1.1MB/s 
Collecting urllib3!=1.25.0,!=1.25.1,<1.26,>=1.21.1 (from requests>=2.18.0->cookiecutter)
  Cache entry deserialization failed, entry ignored
  Using cached https://files.pythonhosted.org/packages/e8/74/6e4f91745020f967d09332bb2b8b9b10090957334692eb88ea4afe91b77f/urllib3-1.25.8-py2.py3-none-any.whl
Collecting python-dateutil (from arrow->jinja2-time>=0.1.0->cookiecutter)
  Cache entry deserialization failed, entry ignored
  Using cached https://files.pythonhosted.org/packages/d4/70/d60450c3dd48ef87586924207ae8907090de0b306af2bce5d134d78615cb/python_dateutil-2.8.1-py2.py3-none-any.whl
Collecting six>=1.5 (from python-dateutil->arrow->jinja2-time>=0.1.0->cookiecutter)
  Cache entry deserialization failed, entry ignored
  Using cached https://files.pythonhosted.org/packages/65/eb/1f97cb97bfc2390a276969c6fae16075da282f5058082d4cb10c6c5c1dba/six-1.14.0-py2.py3-none-any.whl
Installing collected packages: future, click, MarkupSafe, jinja2, poyo, chardet, binaryornot, whichcraft, six, python-dateutil, arrow, jinja2-time, idna, certifi, urllib3, requests, cookiecutter
Successfully installed MarkupSafe-1.1.1 arrow-0.15.5 binaryornot-0.4.4 certifi-2020.4.5.1 chardet-3.0.4 click-7.1.1 cookiecutter-1.7.0 future-0.18.2 idna-2.9 jinja2-2.11.1 jinja2-time-0.2.0 poyo-0.5.0 python-dateutil-2.8.1 requests-2.23.0 six-1.14.0 urllib3-1.25.8 whichcraft-0.6.1
(.venv) insspb@insspb-notebook:~/git/test1328$ cookiecutter -V
Cookiecutter 1.7.0 from /home/insspb/git/test1328/.venv/lib/python3.6/site-packages (Python 3.6)
(.venv) insspb@insspb-notebook:~/git/test1328$ cookiecutter https://github.com/napari/cookiecutter-napari-plugin
full_name [Napari Developer]: 
email [yourname@example.com]: 
github_username [githubuser]: 
plugin_name [foobar]: 
module_name [foobar]: 
short_description [A simple plugin to use with napari]: 
version [0.1.0]: 
minimum_napari_version [None]: 
Select docs_tool:
1 - mkdocs
2 - sphinx
3 - none
Choose from 1, 2, 3 [1]: 2
Select license:
1 - BSD-3
2 - MIT
3 - Mozilla Public License 2.0
4 - Apache Software License 2.0
5 - GNU LGPL v3.0
6 - GNU GPL v3.0
Choose from 1, 2, 3, 4, 5, 6 [1]: 
INFO:post_gen_project:Initializing docs for sphinx
INFO:post_gen_project:Moving docs_sources/sphinx/conf.py to docs/conf.py.
INFO:post_gen_project:Moving docs_sources/sphinx/index.rst to docs/index.rst.
INFO:post_gen_project:Moving docs_sources/sphinx/make.bat to docs/make.bat.
INFO:post_gen_project:Moving docs_sources/sphinx/Makefile to docs/Makefile.
INFO:post_gen_project:Remove temporary folder: docs_sources
INFO:post_gen_project:Remove temporary folder: licenses
INFO:post_gen_project:Remove temporary folder: macros
(.venv) insspb@insspb-notebook:~/git/test1328$ 
Read more comments on GitHub >

github_iconTop Results From Across the Web

ModuleNotFoundError: No module named 'past' #1 - GitHub
This happens if you run python 2, right (or maybe anything below 3.7)? I've added some version information to the readme, plus your...
Read more >
No module named 'past' when installing tensorboard with ...
The command tensorboard --logdir=runs starts ok. But the line self.writer = SummaryWriter(). Gives the following error: ModuleNotFoundError: No ...
Read more >
ModuleNotFoundError: No module named 'past'
Hello, I have the WeatherRack2, and using an RPi 4, I am able to get the raw data feed from the unit to...
Read more >
ModuleNotFoundError: No module named 'past' - RoseIndia.Net
Hi, My Python program is throwing following error: ModuleNotFoundError: No module named 'past' How to remove the ModuleNotFoun.
Read more >
past.builtins ImportError - Code Yarns
past.builtins ImportError ... line 9, in <module> from past.builtins import basestring ImportError: No module named past.builtinsΒ ...
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