emacs/var/elfeed/db/data/6a/6a1d32130f8d7f052150be1957fc145c6229ed1c
2022-01-03 12:49:32 -06:00

1 line
2.2 KiB
Plaintext

<!-- SC_OFF --><div class="md"><p>I am trying to set up pyright with pyvenv. This is what I am doing:</p> <p>I am running on fedora 35 with python 3.10 and emacs 27.2.</p> <p>I install emacs with <code>sudo dnf install emacs</code>. Then I paste this into the <code>.emacs</code> file:</p> <p><code>(require &#39;package)(add-to-list &#39;package-archives&#39;(&quot;melpa-stable&quot; . &quot;</code><a href="https://stable.melpa.org/packages/"><code>https://stable.melpa.org/packages/</code></a><code>&quot;))</code></p> <p>Then I install <code>elpy</code> and <code>pyvenv</code> (I don&#39;t think elpy is necessary) with <code>M-x package-install RET elpy RET</code> ,then I create a virtual environment with <code>M-x pyvenv-create</code> that I activate and work on, which is literally <code>M-x pyvenv-activate</code> and <code>M-x pyvenv-workon</code> I also install use-package with <code>M-x package-install RET use-package RET</code> . Finally I install <code>lsp-mode</code> using: <code>M-x package install RET lsp-mode RET</code> Then I include this to the <code>.emacs</code> file:</p> <p><code>(use-package lsp-pyright:ensure t:hook (python-mode . (lambda()(require &#39;lsp-pyright)(lsp))))</code></p> <p>But when I eval the buffer, I get the error:</p> <p><code>Error (use-package): Failed to install lsp-pyright: Package &#39;lsp-pyright&#39; is unavailable</code></p> <p><code>Error (use-package): Cannot load lsp-pyright</code></p> <p>I am not sure why I get that error or what I am doing wrong. Could it be because I am using python 3.10? I had some issues with elpy because I was using python 3.10. And more importantly, how to resolve that? I&#39;d appreciate if anyone has a tutorial on this.</p> <p>&#x200B;</p> <p>Edit: The code formatting looks awful. Sorry about that. In the <code>.emacs</code> file that formatting (indexing) is fine.</p> </div><!-- SC_ON --> &#32; submitted by &#32; <a href="https://www.reddit.com/user/carlml"> /u/carlml </a> <br/> <span><a href="https://www.reddit.com/r/emacs/comments/r35stm/unable_to_set_up_pyright_with_python_310/">[link]</a></span> &#32; <span><a href="https://www.reddit.com/r/emacs/comments/r35stm/unable_to_set_up_pyright_with_python_310/">[comments]</a></span>