Code Monkey home page Code Monkey logo

Comments (7)

bpleshakov avatar bpleshakov commented on May 24, 2024 1

The python is mapped to python3.8 too.
I actually have zero idea, how poetry script could fall into python2.7.

from poetry-pycharm-plugin.

koxudaxi avatar koxudaxi commented on May 24, 2024

@sapiosexual
Thank you for creating this issue.
I guess the poetry was executed by Python2.7.
The latest version of poetry raises an error when running on python2.7.

Would you please try installing poetry with pipx? https://python-poetry.org/docs/#installing-with-pipx
pipx fix python version for each command.

If some users are confused by this behavior of poetry with pyhton2.7, then I implement fallback action on the plugin to execute python3.x.

from poetry-pycharm-plugin.

bpleshakov avatar bpleshakov commented on May 24, 2024

@koxudaxi
Thank you for your reply.
It seems pipx fixed my issue.
But it is still interesting that usual installation of poetry works fine via cli is executed strictly by python3.8, but plugin runs python2.7 version.
However my issue is closed, have a nice day.

from poetry-pycharm-plugin.

koxudaxi avatar koxudaxi commented on May 24, 2024

@sapiosexual

It seems pipx fixed my issue.

It's great.

But it is still interesting that usual installation of poetry works fine via cli is executed strictly by python3.8, but plugin runs python2.7 version.

The poetry script is specified the python path in the first line.
This path may be python.
I think the plugin executed the interpreter of the path in your environment.

from poetry-pycharm-plugin.

koxudaxi avatar koxudaxi commented on May 24, 2024

@abn
Would you please help us?
We have a problem that the PyCharm plugin gets an error when calling poetry.
The reason is the poetry is executed by Python2.7.

This plugin calls poetry from a new process.
I guess this process detects the python execution on line 1 of the poetry file.

$ head -n 1 `which poetry`
#!/usr/bin/env python

A lot of systems will get python2.7 from this shebang.
Unfortunately, Poetry cuts Python2.7, and poetry returns an error when it is executed from Python2.7.

I found a workaround that we use pipx to install poetry.

But, I think a lot of users don't choose this way.
I have two ideas to resolve this problem.

  1. Poetry plugin execute poetry with python3 executable.

  2. Poetry change shebang to python3. #!/usr/bin/env python3

PRO:
We don't touch poetry source code.
CON:
Should we force using Python3? some users may use python2.7 with older poetry.

PRO:
The changes affect only the latest version of users of poetry.
It may help non-pycharm users.

CON:
I don't know how it impacts on source code of poetry.
Windows environment might not the same executable name.

How do you think about this problem?

from poetry-pycharm-plugin.

bpleshakov avatar bpleshakov commented on May 24, 2024

@koxudaxi but as far as I understand pycharm plugin offers to select base interpreter.
Why just don't use this executable?

Moreover, I think plugin should detect poetry version and show a warning in case user picks python base interpreter that is incompatible with poetry version.

from poetry-pycharm-plugin.

koxudaxi avatar koxudaxi commented on May 24, 2024

@sapiosexual
I'm sorry for my late reply.

but as far as I understand pycharm plugin offers to select base interpreter.
Why just don't use this executable?

In some cases, the plugin has already detected the base interpreter.
But, It isn't all case. The plugin needs to execute poetry before users select the base interpreter.

Moreover, I think plugin should detect poetry version and show a warning in case user picks python base interpreter that is incompatible with poetry version.

I think this problem is on the poetry side.
We should resolve the problem as possible outside of the plugin.

from poetry-pycharm-plugin.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.