Git Product home page Git Product logo

Comments (8)

techpixel avatar techpixel commented on September 2, 2024 1

No need for this. Replit just failed to guess the package.

To get around this, add #upm package(package-name) at the end of your import statement

Ex.

import discord #upm package(discord.py)

For more information check the docs

from upm.

JDJGInc avatar JDJGInc commented on September 2, 2024 1

this shouldn't be needed here, it should just use the right library.

from upm.

lmmx avatar lmmx commented on September 2, 2024 1

This is not a scalable way to install Python packages, this should be turned off if packaging metadata is available (and should create that packaging metadata on first run, therefore switching itself off). I.e. the correct thing to do is to defer to pyproject.toml dependencies, and not haphazardly guess from import statements. I keep checking back to find it not fixed, Iā€™d love to try Replit but this is a show stopper for me.

Iā€™d really like to see this prioritised and thought I should comment rather than just intermittently checking for progress.

from upm.

blast-hardcheese avatar blast-hardcheese commented on September 2, 2024 1

This dovetails with some of the work we've been doing recently to improve the dependencies search pane, I'll see what can be done to improve this. Thanks for your patience, all, agreed that this should definitely not be up to the user to inform the tool to behave correctly.

from upm.

blast-hardcheese avatar blast-hardcheese commented on September 2, 2024 1

@lmmx Sorry for closing this issue without comment, there were a few different threads here that I was trying to address, it looks like I missed the main one.

Is there a way to turn off upm guess from running automatically when I run my repl?

Yes. Add the following line in the root section of your .replit file (up top, at the same level as run):

disableGuessImports = true

This will disable upm guessing entirely. This configuration option is not publicly documented, but there is discussion on Ask, which suggests the omission of that config option in our docs should be addressed.

More broadly, work on improving the guesser has continued in #15. Hopefully this resolves the issue, and again I do apologize for not communicating more around how/why this issue was closed.

from upm.

lmmx avatar lmmx commented on September 2, 2024 1

Oh thank you for documenting here! Sorry I thought it was just being swept under the rug lol, love to see it! Congrats on solving at long last šŸ˜ƒ

from upm.

francosang avatar francosang commented on September 2, 2024

I have the same problem with the Discord API wrapper.

The code for importing the package is import discord, so UPM wrongly guesses that the package is called discord and adds it with poetry add discord.
(According to https://pypi.org/project/discord/ that package should not be used, the correct package is discord.py).

Anyways, my problem is that I need to use the master branch of that package's repo, so I added the package manually to the toml file:

[tool.poetry.dependencies]
python = "^3.8"
"discord.py" = { git = "https://github.com/Rapptz/discord.py.git", branch = "master" }

But UPM adds discord again even if discord.py is already imported.
So, in the end, my toml file ends up looking like this...

[tool.poetry.dependencies]
python = "^3.8"
"discord.py" = { git = "https://github.com/Rapptz/discord.py.git", branch = "master" }
discord = "^1.7.3"

...with two different versions of the same package imported twice. Which is not great.


Turning UPM off or stopping it would be a good solution.

from upm.

lmmx avatar lmmx commented on September 2, 2024

Er... I was using this issue to track whether this bug was resolved or not. It just got closed after a list of manual replacements has been added to in #191 ("guess package suggestions"). I don't think this is solving the problem

from upm.

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.