Python Forum
Problems reading modules and the auto filler - Printable Version

+- Python Forum (https://python-forum.io)
+-- Forum: Python Coding (https://python-forum.io/forum-7.html)
+--- Forum: General Coding Help (https://python-forum.io/forum-8.html)
+--- Thread: Problems reading modules and the auto filler (/thread-25685.html)



Problems reading modules and the auto filler - Tomli - Apr-08-2020

Hello everyone!

Wish someone can help me with the following two problems I have been getting

(Just to clarify I’m using VSC as my text editor, my compiler is at version 3,8 downloaded from the official page and mi os is Windows)

1) For some modules I get something like the following:

[Image: BcwvOBh.png]
Which is a lie because the auto filler show me that the method exist and is inside in this case of the random module. And another thing is that if I compile the script I get the result that I’m looking for despite of the problems that the compilers arises.

2) Sometimes the auto filler doesn’t show me the attributes of my object:

[Image: H0lcjTN.png]
Other times, it won’t show me anything besides these abc things (Abstract Base Classes probably? Is the only thing that comes to mi mind, but I’m not really familiar with this module so even if I’m correct assuming that’s the origin for abc I still don’t know why it appears here)

[Image: eAVgodM.png]
Hope someone can give me a hand with these problems, they have proven themselves to be really bothersome

For everyone that have readed until this point, thank you very much and I hope you have an amazing day
!



RE: Problems reading modules and the auto filler - Larz60+ - Apr-08-2020

I'm running python 3.8.1:
captainkirk$ python
Python 3.8.1 (default, Dec 19 2019, 16:08:07) 
[GCC 7.4.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import random
>>> print(random.randint(1,2))
1
>>>
Try: python -V from command line.
is envieonment varialbe pointing to python 3.8?


RE: Problems reading modules and the auto filler - Tomli - Apr-09-2020

(Apr-08-2020, 09:41 AM)Larz60+ Wrote: I'm running python 3.8.1:
captainkirk$ python
Python 3.8.1 (default, Dec 19 2019, 16:08:07) 
[GCC 7.4.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import random
>>> print(random.randint(1,2))
1
>>>
Try: python -V from command line.
is envieonment varialbe pointing to python 3.8?

Thanks for answering!
yes it is:
[Image: GN9YTbC.png]


RE: Problems reading modules and the auto filler - Larz60+ - Apr-09-2020

which extensions are you using? (VSCode)


RE: Problems reading modules and the auto filler - Tomli - Apr-09-2020

(Apr-09-2020, 02:05 AM)Larz60+ Wrote: which extensions are you using? (VSCode)

These 4:

[Image: 3IGNwt3.png]
do you think one of them is the problem?


RE: Problems reading modules and the auto filler - Larz60+ - Apr-09-2020

I'm pretty sure most of the moderators here also use IntelliSense,
I do and have noticed some peculiar quirks from time to time, but guess I've kind of learned to just work around them.
At any rate Microsoft should be contacted about noticed anomalies: https://developercommunity.visualstudio.com/content/problem/340283/intellisense-bug.html

I also have all the other extensions that you show installed, and haven't found anything That I could call a bug.

I've been a Linux guy since the start, Unix prior to that, and not a huge fan of Microsoft products. Most contain numerous bugs.


RE: Problems reading modules and the auto filler - snippsat - Apr-09-2020

Make sure interpreter is selected down in left corner(so for you eg Python 3.8.1 64-bit).
You have the Python extension,so the only two thing that's is required is the Python extension and that a interpreter is selected(left corner).
Then the python-language-server should run automatically.

Can watch to see if it running Ctrl+Shift+P --> View:Toggle Output --> Now select: Python language Server.
Example image,now i started with 3.7 the switch to 3.8(left corner) and language Server do all automatically.
[Image: DEw64b.png]
There can be some problem like Pillow im. that you show,but in general if work very well.
Look here for more setup stuff VS Code from start

Larz60+ Wrote:At any rate Microsoft should be contacted about noticed anomalies: https://developercommunity.visualstudio....e-bug.html
Your linking is wrong Larz,now you link to Visual Studio and not VS Code and the important part Open Source ("Code - OSS") which Visual Studio is not.


RE: Problems reading modules and the auto filler - Larz60+ - Apr-09-2020

Thanks for correction.


RE: Problems reading modules and the auto filler - Tomli - Apr-10-2020

Larz60+ and Snippsat first of all thank you very much for all your help guys!

I don't want any of you to hate me, but somehow now the random lib is working just fine (didn't do anything, just realize it when I was recreating the code to follow Snippsat's recommendation and saw that there was no error underline).

[Image: AI4XWri.png]
For the other problem. Snippsat I think you are right about the problem being with the im object, the only two libraries which I've gotten this problem with IntelliSense where 3rd party ones, so it makes total sense it has something to do with them (nothing like this happend with the builtins modules or with other popular 3rd party libraries like pandas)

Once again thank you very much for all your help, now I'm going to read that link for VSC setup (I'm 100% sure it will come handy Big Grin )