Python module imports Visual Studio - python

I have installed openpyxl. Working through the examples in Idle, I encounter no issues.
Trying to use my VisualStudio python editor, module imports fail.
Does openpyxl need to be added to IronPython for this to work? If so, how?

openpyxl does not work with IronPython. But that should not affect using it with VisualStudio. Presumably you need to set the path for the project.

Related

IntelliSense in Visual Studio Code not working with python packages

I am fairly new to python. So I installed python and my editor is Visual Studio Code. The Intellisense seems to work for this code (extension BeautifulSoup):
enter image description here
But it doesn't work for this:
enter image description here
I tried to restart my computer, but it didn't help.
I have also tried to use virtual enviroments and I also selected the right associated interpreter. To use python in Visual Studio Code, I installed following extensions:
MagicPython
Pylance
Python
Python Extension Pack
Visual Studio IntelliCode
Do you have any Idea why my Intellisense is not working for packages?
In VS Code, the "Intellisense" function of Python code is provided by the the Python extension, and the language service provided by "Pylance" provide us with docsing content.
Therefore, it is recommended that you "disable" other extensions to avoid interference between them and affect the use of the "Intellisense" function.
In addition, if it still doesn't work, please reinstall the Python extension and reload VS Code.

Unable to resolve 'requests'. IntelliSense may be missing for this module. Visual Studio/Python

Using Visual Studio with Python. I'm getting this warning when importing requests.
Unable to resolve 'requests'. IntelliSense may be missing for this module.
In the Python Environments tab, you can see that I have requests installed down in my packages.
I'd like to have IntelliSense while working with 'requests'. Is there something I may have overlooked?
1.Maybe it's something similar to this issue. Deleting the init.py in top-level of your project can help resolve this issue.
2.If the above not helps, please try reloading the project.
After my test, sometimes in a python application, after the first time we install a python package, the intellisense for the new package in current project won't work until we reload the project file to recognize the new package.
For this situation, the easy workaround is: Right-click the project in Solution Explorer=>choose unload the project=>Right-click it again and choose reload the project. Then the intellisense for the new package would work well.
Hope it helps and sorry for the delay!

Preload custom module python vscode

Does the new python language server available in Visual Studio Code based on the Visual Studio one allows for the preload module option.
"python.autoComplete.preloadModules": []
And if it does indeed work with it, does it work with project modules or only modules installed in the virtualenv?
Doing something like "python.autoComplete.preloadModules": ["/path/to/module"] would work on the any of both implementations?
You can add them like below
"python.autoComplete.preloadModules": ["numpy", "pandas", "matplotlib"],
also, check the docs! :)
https://code.visualstudio.com/docs/python/editing#_autocomplete-and-intellisense

Intellij Idea: Python import showing error even when code using module is running

I am working on a python project using editor Intellij Idea, Ultimate 2017 Edition.
In my working file sample.py code looks like
import os
def sample_fuc():
print(os.stat("C:\\Users\admin"))
Python SDK is already configured, code is running fine [When running through intellij run configuration] and printing the desired result, but somehow Intellij is not able to find the module os and showing error No module named os
So, I want to understand 2 things here :
1.) How does Intellij idea searches for modules available in python libraries. Do I need to configure somewhere in intellij to look for available modules. Is there something default set to it, if yes, why common module like os is not available in default path?
2.) If I need to configure, what all directory paths python usually have on windows where it stores installed modules?
possible intellij is not able to identify your python interpreter path.
refer: How do I get IntelliJ to recognize common Python modules?

py2exe and win32com

Can py2exe create standalone executables even ones requiring the win32com package?
I've googled / searched SO to no avail.
I've used py2exe for a project that depended on win32com as well as pysvn. It worked fine, no hassles.
That was using Python 2.5 and later 2.6. Note that py2exe doesn't support Python 3.x.
Yes, it can. But you may need to add a refereneces to DLL that your application needs.
Check the bottom of http://www.py2exe.org/index.cgi/WorkingWithVariousPackagesAndModules . It contains useful resources to build Python apps that uses win32com.
Also if you use typelibs, check that the version is the same on all Windows versions you want to deploy. Otherwise, your app may fail

Categories

Resources