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

Unable to install the plugin with CLI #5

Open
AlexAndorra opened this issue Dec 25, 2020 · 2 comments
Open

Unable to install the plugin with CLI #5

AlexAndorra opened this issue Dec 25, 2020 · 2 comments

Comments

@AlexAndorra
Copy link

Hi team, and thanks a lot for developing this plugin!

Bug description
I just tried to install the plugin with lektor plugins add lektor-disqus-comments, but this raises NameError: name 'long' is not defined. Do you happen to have an idea of where it's coming from?

Thanks in advance for the help, and happy holidays 🎄 🎁 🍾

Packages

  • flask: 1.1.2
  • lektor: 3.1.3
  • python: 3.9.0

Full traceback

Traceback (most recent call last):
  File "/Users/alex_andorra/opt/anaconda3/envs/wedding/bin/lektor", line 10, in <module>
    sys.exit(main())
  File "/Users/alex_andorra/opt/anaconda3/envs/wedding/lib/python3.9/site-packages/lektor/cli.py", line 627, in main
    cli.main(args=args, prog_name=name)
  File "/Users/alex_andorra/opt/anaconda3/envs/wedding/lib/python3.9/site-packages/click/core.py", line 782, in main
    rv = self.invoke(ctx)
  File "/Users/alex_andorra/opt/anaconda3/envs/wedding/lib/python3.9/site-packages/click/core.py", line 1259, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/Users/alex_andorra/opt/anaconda3/envs/wedding/lib/python3.9/site-packages/click/core.py", line 1259, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/Users/alex_andorra/opt/anaconda3/envs/wedding/lib/python3.9/site-packages/click/core.py", line 1066, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/Users/alex_andorra/opt/anaconda3/envs/wedding/lib/python3.9/site-packages/click/core.py", line 610, in invoke
    return callback(*args, **kwargs)
  File "/Users/alex_andorra/opt/anaconda3/envs/wedding/lib/python3.9/site-packages/click/decorators.py", line 73, in new_func
    return ctx.invoke(f, obj, *args, **kwargs)
  File "/Users/alex_andorra/opt/anaconda3/envs/wedding/lib/python3.9/site-packages/click/core.py", line 610, in invoke
    return callback(*args, **kwargs)
  File "/Users/alex_andorra/opt/anaconda3/envs/wedding/lib/python3.9/site-packages/lektor/cli.py", line 505, in plugins_add_cmd
    info = add_package_to_project(project, name)
  File "/Users/alex_andorra/opt/anaconda3/envs/wedding/lib/python3.9/site-packages/lektor/packages.py", line 62, in add_package_to_project
    cfg['packages.%s' % canonical_name] = version
  File "/Users/alex_andorra/opt/anaconda3/envs/wedding/lib/python3.9/site-packages/inifile.py", line 463, in __setitem__
    self._changes[name] = self.dialect.to_string(value)
  File "/Users/alex_andorra/opt/anaconda3/envs/wedding/lib/python3.9/site-packages/inifile.py", line 172, in to_string
    if isinstance(value, (int, long, float)):
NameError: name 'long' is not defined
@runfalk
Copy link
Member

runfalk commented Dec 26, 2020

This seems to be a Python 3 error in the inifile dependency (https://github.com/mitsuhiko/python-inifile/blob/master/inifile.py). Which is really weird because that has been fixed since in the current version which was released in 2017.

Your lektor version is old, but 3.1.3 did not pin the version of the inifile dependency. Have you added any other plugins? As this plugins doesn't have any dependencies I doubt that it's the cause. Did the virtualenv work before this? Could you run lektor server before adding the plugin?

How did you install lektor?

@AlexAndorra
Copy link
Author

Thanks for your answer @runfalk !

Have you added any other plugins?

Yes, here are all the plugins my project has:

[packages]
lektor-markdown-header-anchors = 0.3
lektor-markdown-highlighter = 0.3
lektor-simplemde = 0.5
lektor-tags = 0.2
lektor-disqus-comments = 0.4.1

Did the virtualenv work before this? Could you run lektor server before adding the plugin?

Yes and yes. I had absolutely no problem developing the website before that.
Actually, the funny thing is that I just discovered installing lektor-disqus-comments works when you add it to the .lektoproject file! It's only when you do lektor plugins add lektor-disqus-comments that it fails, with the error above 🤔

How did you install lektor?

I installed everything with an environment.yml file and conda-forge. Here it is for reference:

channels:
- conda-forge
dependencies:
- python>=3.7
- pip
- lektor
- flask
- requests
- jinja2
- werkzeug
- mamba

Does any of this help?

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