Python Forum
Problems reading modules and the auto filler
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Problems reading modules and the auto filler
#1
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
!
Reply
#2
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?
Reply
#3
(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]
Reply
#4
which extensions are you using? (VSCode)
Reply
#5
(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?
Reply
#6
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....e-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.
Reply
#7
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.
Reply
#8
Thanks for correction.
Reply
#9
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 )
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
Sad problems with reading csv file. MassiJames 3 559 Nov-16-2023, 03:41 PM
Last Post: snippsat
  Problems with modules mectos 0 1,401 May-19-2020, 12:51 PM
Last Post: mectos
  Other modules for reading audio files? jedzz 0 1,570 Mar-25-2020, 11:07 PM
Last Post: jedzz
  Modules issue, pip3 download modules only to pyhton3.5.2 not the latest 3.6.1 bmohanraj91 6 8,352 May-25-2017, 08:15 AM
Last Post: wavic

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020