Giter Site home page Giter Site logo

Comments (10)

ntcong avatar ntcong commented on June 15, 2024 17

1 way to partially fix this is always prefers the current python environment. If vim was started inside a virtualenv then default the interpreter to virtualenv, if it was not then using the default python.

Remembering the choice is great but it might require some hard decision

from coc-python.

chemzqm avatar chemzqm commented on June 15, 2024 9

Fixed by use a json file (~/.config/coc/memos.json) to store the selected python path.

The limitation is it can't support multiple workspaceFolders.

from coc-python.

mike-hearn avatar mike-hearn commented on June 15, 2024 4

I think I'm personally opposed to using .env, only because that's typically used for application configuration by a lot of frameworks (for example, pipenv automatically imports all vars in .env into the shell when activating the virtual environment). I'd personally prefer to keep my editor/IDE config separate from that to avoid any conflicts/complexity it could introduce.

from coc-python.

chemzqm avatar chemzqm commented on June 15, 2024 3

Still buggy, need some rework, the logic of this part form vscode-python is quite complex.

from coc-python.

chemzqm avatar chemzqm commented on June 15, 2024 2

VSCode create .vscode folder with settings in your project, coc.nvim need to create .vim folder with settings to resolve this problem.

from coc-python.

chemzqm avatar chemzqm commented on June 15, 2024 1

is there any plan on fixing this

Sure, will fix this ASAP.

from coc-python.

ntcong avatar ntcong commented on June 15, 2024

can we use .env file for some basic settings? Creating a .vim folder seems a bit overkill (no plugin is using it)

from coc-python.

modesitt-sesco avatar modesitt-sesco commented on June 15, 2024

is there any plan on fixing this - how else can I currently use the python interpreter inside /.venv in whatever project I happen to be working in?

from coc-python.

CanyonTurtle avatar CanyonTurtle commented on June 15, 2024

I am having the same issue as @ntcong when I try to select a different python interpreter with the quickpick menu. The interpreter doesn't seem to change from its initial value no matter what I choose. I am using:

  1. coc-python v1.1.4
  2. pipenv 2018.11.26
  3. python 3.7.3 (built from source)

Additionally, here is the output of :CocInfo on my nvim instance.

  2 ## versions
  3
  4 vim version: NVIM v0.4.0-566-gd5fd0732e
  5 node version: v10.15.2
  6 coc.nvim version: 0.0.64
  7 term: screen-256color
  8 platform: linux
  9
 10 ## Error messages
 11
 12 ## Output channel: snippets
 13
 14 ## Output channel: PythonStarting Jedi Python language engine.
 15 ##########Linting Output - pylint##########
 16 ##########Linting Output - pylint##########
 17 ************* Module linreg
 18 24,0,error,syntax-error:Format strings are only supported in Python 3.6 and greater (<unknown>, line 24)
 19
 20

I am setting up a virtual environment with pipenv (i.e. pipenv shell) and then starting nvim within that environment, and I am sure that the python path of this virtual environment is the very first thing on my path at the time I run nvim. (My path starts like this: /home/CanyonTurtle/.local/share/virtualenvs/pythontests-jqiNevtW/bin:/… Yet, it still selects /usr/bin/python3, and I cannot successfully select anything else. /usr/bin is also on my path.

@chemzqm thank you for working on this issue. I am glad I found coc-python!

from coc-python.

modesitt-sesco avatar modesitt-sesco commented on June 15, 2024

I agree @ntcong that seems to be the most straightforward. If personal settings need be saved in a .vim directory and can not be saved elsewhere like to the coc-extensions file in ~/.vim, and that this is a larger endeavor, I think these choices should be temporarily removed from :CocCommand until they work as described.

from coc-python.

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.