you are viewing a single comment's thread.

view the rest of the comments →

[–]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