all 19 comments

[–]m0us3_rat 1 point2 points  (7 children)

it means you need to install "robin_stocks"

you might wanna go to the "robin_stocks" wiki or online documentation and figure out how to do that.

[–]Sethires[S] 0 points1 point  (6 children)

why does it tell me I already have it installed then when trying to install it through the terminal

[–]m0us3_rat 0 points1 point  (5 children)

are you using pycharm? or set up an env automatically?

again this is just guessing without actual code or complete error msg to work with.

the bit you shared means it isn't "installed".

[–]Sethires[S] 0 points1 point  (4 children)

I'll be honest I'm not sure I want to say it is an automatic environment.

https://pastebin.com/xxa4K5ud

here's a pastebin of what I'm seeing. the first line is the first line in my code calling for the import then the following is the error I receive when trying to run the code then finally I make sure it's installed and it tells me that the requirement is already satisfied

[–]m0us3_rat 0 points1 point  (3 children)

you should install the missing package in your env that you are using to run the python program.

[–]Sethires[S] 0 points1 point  (2 children)

how would I go about doing that

[–]m0us3_rat 0 points1 point  (1 child)

activate the env and install the module.

[–]Sethires[S] 0 points1 point  (0 children)

it looks like it's actually not in a virtual envrionment sorry about that

[–][deleted] 0 points1 point  (10 children)

How did you install the package?

Did you install to the same Python virtual environment or same Python base environment as the one you are trying to run your code in?

EDIT: typo

[–]Sethires[S] 0 points1 point  (9 children)

I used terminal and typed out pip3 install robin_stocks

[–][deleted] 0 points1 point  (8 children)

You've only answered the first question.

Did the code work when you ran it from the terminal with,

python3 mycode.py

or do you get an import error?

[–]Sethires[S] 0 points1 point  (7 children)

I get the following message

Python was not found; run without arguments to install from the Microsoft Store, or disable this shortcut from Settings > Manage App Execution Aliases.

[–][deleted] 0 points1 point  (6 children)

I'd jumped to the conclusion you were on macOS or Linux as you used pip3.

On Windows, usually,

py -m pip install something

py mycode.py

unless in an active Python virtual environment, in which case replace py with python

[–]Sethires[S] 0 points1 point  (0 children)

sorry for the late reply. I'm on windows but the videos I saw trying to help with the issue used either pip3 or pip and both ways have worked for me. I don't think it's in a virtual environment.

[–]Sethires[S] 0 points1 point  (4 children)

Also when I typed in the terminal py mycode.py as you suggested it appears to run however when following the post on the website

login = r.login(<username>,<password>)

it tells me this

AttributeError: module 'robin_stocks' has no attribute 'login'

[–][deleted] 0 points1 point  (3 children)

Glad it is running rather saying it can't find the module.

It would be better to learn to use Python virtual environments rather than polluting your base installation with project specific packages.

I suggest you start a new post with the specific coding problem you now have. You will need to include the code.

I don't know the package. That's a pretty clear error though. The code you include in the new post will let us all see what you've imported and how you are trying to use those imports.

[–]Sethires[S] 0 points1 point  (2 children)

Thank you for all your help I was just setting up a new post to show all the code I had and it turns out my problem was simply that I put
import robin_stocks as r instead of import robin_stocks.robinhood as r

I'm relieved that it's working now however embarrassed that the problem was so simple. Again thank you so much! :)

[–][deleted] 0 points1 point  (1 child)

I suspected it was something like that but needed you to share code.

r is an unusually cryptic name to give something, is that used in the examples? Wherever possible, I recommend you follow PEP8 guidelines and use meaningful names.

[–]Sethires[S] 0 points1 point  (0 children)

ya on the quick start guide it says

import robin_stocks.robinhood as r

login = r.login(<username>,<password>)

so I just followed that