ERROR: Could not find a version that satisfies the requirement azure-functions - python

I have been doing this exercise:
Create a function in Azure using Visual Studio Code
https://learn.microsoft.com/en-us/azure/azure-functions/functions-create-first-function-vs-code?pivots=programming-language-python
After doing the following steps:
Select a language for your function project: Choose Python.
Select a Python alias to create a virtual environment: Choose the location of your Python interpreter. If the location isn't shown, type in the full path to your Python binary.
Select a template for your project's first function: Choose HTTP trigger.
Provide a function name: Type HttpExample.
Authorization level: Choose Anonymous, which enables anyone to call your function endpoint. To learn about authorization level, see Authorization keys.
Select how you would like to open your project: Choose Add to workspace.
I press F5 to Run the function locally
And this is the error I get:
I have python, pip, wheel, azure-function tools installed
PS C:\Users\Mustafa Saifee\azfunc> python --version
Python 3.8.2
PS C:\Users\Mustafa Saifee\azfunc> pip --version
pip 20.1 from c:\program files\python38\lib\site-packages\pip (python 3.8)
PS C:\Users\Mustafa Saifee\azfunc> wheel version
wheel 0.34.2
PS C:\Users\Mustafa Saifee\azfunc> pip install azure-functions
Requirement already satisfied: azure-functions in c:\program files\python38\lib\site-packages (1.2.1)
Operating System: Microsoft Windows 10 Education 10.0.19041 Build 19041
How do I get this problem solved? Please help
Tried this as well:
I tried python 3.7 and 3.8
plus I also tried it with the conda based python.
Then I uninstalled everything. And one by one installed it back. Still the issue persists
I just want that error gone so that I can complete the rest of the exercise.
(I have posted this issue on my GitHub Repository as well if incase you can tag someone from the #azure-functions team on my GitHub Issue)

#aprilspeight helped me solve this issue. So this issue can be closed.
The solution is given by #aprilspeight: Have you tried running
the function while the init.py file is active on the screen?
There shouldn't be a need to modify anything in the function.json file
if you're trying out the Quickstart. Therefore, ensure that you're
looking at the init.py file when you Start Debugging (F5).
The whole issue can be read HERE

Related

New to Python. Which version of PyYAML do I need to install in my Python Azure runbook?

I have a basic Python script that I'm executing in an Python Azure Runbook. I need to install the PyYAML package but I don't know how to do it. I have installed other packages ok as when I download from PyPI they come with the name format *****-py3-none-any.whl. I've tried several of the packages in PyPI for PyYAML however they all seem OS specific and they won't install in the Azure Automation account as I get the following error...
Runtime version
3.8
Error
Orchestrator.Activities.PythonPackageExtractException: Error while extractinig Python package: Unexpected file structure in .whl file for python package PyYAML. It is likely that the package is for an unsupported platform. at Orchestrator.Activities.SetModuleActivity.ExecuteInternal(CodeActivityContext context, Byte[] moduleContent, String moduleName, ModuleLanguage moduleLanguage, Guid moduleVersionId, String modulePath) at Orchestrator.Activities.SetModuleActivity.Execute(CodeActivityContext context) at System.Activities.CodeActivity.InternalExecute(ActivityInstance instance, ActivityExecutor executor, BookmarkManager bookmarkManager) at System.Activities.Runtime.ActivityExecutor.ExecuteActivityWorkItem.ExecuteBody(ActivityExecutor executor, BookmarkManager bookmarkManager, Location resultLocation).
Does PyYAML not support Azure Runbooks, or is there another version somewhere that would work as none of the ones here...
https://pypi.org/project/PyYAML/6.0/#files
...would seem to fit?
Any help would be greatly appreciated :(
In case any other noobs find this in the future, I sorted this by making the Python runbook install PyYAML by running this command in a separate runbook:-
import pip
pip.main(['install', 'PyYAML'])
This then gave me the version that worked, which for the record was...
PyYAML-6.0-cp38-cp38-win_amd64.whl

How do i install a Prject interpeter that cannot be found in the pycharm explorer

I am trying to install the huobi_python lib to my pycharm however i'm unable to do so. I have tried multiple times to add it and google it but did not succseed. Does anyone know how to fix this?
Github link:https://github.com/huobiapi/huobi_Python
Running windows 10, no i cannot find it in Project interpeter and with the + sign. Those are mostly REST api's
You wouldn't add it as an interpreter.
Since the project isn't available as pip install, you'd have to build it from source. Meaning clone the repo, and run the command listed in the installation section from the command prompt. Also make sure that you're using Python3.7, as listed there.
Your interpreter then would have to just be Python 3.7, which will allow you to import the modules from other Python code
from huobi import RequestClient
# your code

0x80070643 error while installing Python 3.6

I'm actually using Python for an audio steganography project but I have some troubles.
I searched this error code on the forum, but I found things about SQL installations and not Python.
I'm trying to re-install Python 3.6.5 after an uninstall, because of a bug with pip.
I installed Python 2.7, Python 3.6.5, Python with VS 2017, before uninstall it because it wasn't working.
However, when I'm runing the installer as an administrator, hit "customize installation", tick everything excpet "balblalblabal (this requires VS 2015 or later)", and click on "install", it tells me that :
.
I realy need Python to work and I'm now stuck ...
If anybody here could help me, it would be nice !
Thanks all,
maleik.
PS : I have the log for you :*
The log link
I found this in the log file which you have attached. Try cleaning the registry with CC cleaner and give it a try. If it still doesn't work, try installing python with web installer Python Web Installed 3.6.5.
[3DA0:2968][2018-12-05T20:46:18]e000: Error 0x80070643: Failed to install MSI package.
[3DA0:2968][2018-12-05T20:46:18]e000: Error 0x80070643: Failed to execute MSI package.
[2610:03A4][2018-12-05T20:46:18]e000: Error 0x80070643: Failed to configure per-machine MSI package.
[2610:03A4][2018-12-05T20:46:18]i319: Applied execute package: core_AllUsers, result: 0x80070643, restart: None
[2610:03A4][2018-12-05T20:46:18]e000: Error 0x80070643: Failed to execute MSI package
I installed python from Microsoft store after facing this problem and it magically got installed without any error as it may have directly been installed. I don't know but try if it eorks for you too.
You need to run the installation as a local administrator.
I had the same problem installing Python version 3.9 for the first time on my Windows 10, as this same problem happens to many users trying to install Python, the best solution I accidentally, just like #MANAN AGGARWAL discovered trying to check if I already had a version of Python installed on my computer by the DOS Command Prompt, was:
Open the DOS Command Prompt (cmd) and dictate "python": if a screen shows you a version, it's clearly not the first time you've installed Python, so if you want to upgrade you should try: https: / /www.delftstack.com/en/howto/python/how-to-update-python/ But if you've never installed any version of Python, the solution lies in updating your operating system to the latest version through Windows Update, and open the command prompt and type Python, or go directly to the Microsoft Store and search for Python followed by its latest version. It works without error.
** If by chance it does not automatically install on your PC after downloading, click "install on my devices" and select your computer name.
Why can't I install Python directly from the website file? Please note that when trying to install any software/applications from outside Microsoft's trusted locations, there are high chances of user settings interfering with the installation. When coming, for example, from the Microsoft Store, a chance of success is much greater, even without having problems related to User Permission Settings.
Another important thing to point out here is that installing a lot of software from outside Microsoft's trusted platforms can cause you to change some user permissions which can have positive effects with some software and negative effects with others, even with security your own system if you don't know what you're doing.
it's simple , Try Lower Version Like 'Python 3.6' but Download web install.
install it , then install last python version.
your python will update.
I've faced same/similar problem with installing Python 3.9.12 in a clean Windows 8.1 64-bit (VirtualBoxed test environment).
I thought the issue could have been fixed in a newer version of Python, but the freshest 3.10.10 fails with same issue.
The original log isn't available any longer, but luckily it is quoted in another answer, and the following line reveals the real problem:
Applied execute package: core_AllUsers, result: 0x80070643, restart: None
My log looks the same, and if you scroll the log up, you'll discover that core_AllUsers is a UCRT MSI-installer, which is downloaded from Python site (for 3.10.10 64-bit the link may look like https://www.python.org/ftp/python/3.10.10/amd64/ucrt.msi).
If you download it manually (Python installer is smart enough to do a cleanup even if it fails, so you won't find this MSI in a local cache) and run, it will probably crash. And if it is your case, I have a simple solution - just install update KB2999226 (Update for Universal C Runtime) for your OS, which you can download from Microsoft.
I also faced the similar issue. What the trick worked for me is I installed it for the individual user (as earlier installation was for the all users).
So earlier if one has installed it for the all users then install it for the specific user and vice versa.
I know this is not the resolution of the error faced. However, this approach will install Python which is the main motive to achieve.
I encountered the same issue after installing a fresh Windows 8.1 on my PC.
I solved that by using the Python v3.9 web installation file which you can find here.
However, you can choose any other version that has a web installation file
Note: You need internet connection to use this method.

PySCIPOpt/SCIP - isLPSolBasic() not in pyscipopt.scip.Model

I developed a gomory cut for a LP problem (based on 'test-gomory.py' test file) which I could not manage to run. Finally, I copied the test file to check whether I'd the same trouble. Indeed I got the same message:
if not scip.isLPSolBasic():
AttributeError: 'pyscipopt.scip.Model' object has no attribute 'isLPSolBasic'
I have downloaded SCIPOptSuite 5.0.1 win64, set up path and installed pyscipiopt using pip on conda.
I cannot figure what is wrong, except that I may have failed to install pyscipopt properly? Thank you for pointing me in the right direction.
Your assumption is correct: The pip version of PySCIPOpt was outdated and did not yet include the latest updates with respect to cutting plane separators. I just triggered a new release build (v.1.4.6) that should be available soon.
When in doubt, you can always build PySCIPOpt from source by running python setup.py install from within the project directory.

Python install error "A newer version of the Python launcher is already installed"

I am trying to reinstall Python, so I go control panel > uninstall > Python 3.6.2. It succeeds, but when I try to download 3.6.*, it says that I can't download because there is already a version of Python3 installed.
I tried to clean the registry, deleted all files named "Python", but still see the error. I even deleted the path Python in PATH.
This may be a silly solution, but for me the issue was the Python Launcher still listed in the apps list after the uninstall. Uninstalled it separately, afterwards reinstalled Python without the error.
The installer/uninstaller does not do a good job of cleaning up after itself (and that's being generous). What worked for me:
Remove all python binary folders from Program Files and Users\<username>\AppData
Clean the PATH of any and all mentions of python
Search the registry in Computer\HKEY_CLASSES_ROOT\Installer\Features for any values with python, then delete the containing key. The key names are things like "03CEBFB8CC334B3148F9B330F67264A6" (that's an example, not an actual one, since the actuals I deleted)
#3 is the one that actually got it past the hurdle, but #1 and #2 should be done anyway.
My issue persisted despite all the above. If you're still having issues:
I realized the Python installer shows a log file link... wish I had noticed it sooner. Click to open that log, search for "Detected". Find all lines with "Detected related package". These lines are specifically what's tripping the installer. Notice the version numbers are higher than the version you're installing, along with the "Operation: Downgrade"s).
Once you find these GUIDs in your log, you'll need to search each of them in the registry. I use a free registry tool called Resplendence Registry Registrar Manager (I have no connection with them), which searches the registry blazingly fast and will show everywhere it finds something. But you can also just use Windows' native RegEdit, as well.
When you find one of these GUIDs in the registry, rename the key by adding an underscore to it, like below. This is the equivalent of "deleting" them -- as far as the Python installer can tell -- but without actually deleting them. You can easily revert them if needed.
Re-run the Python installer and it should now install just fine.
Delete all the files of the old version python and try to re-install to uninstall the older version you can do it from control panel
Install another version. For example, if you are installing a 64-bit installation, then try to install 32-bit.
Download zip file from below URL.
https://www.python.org/ftp/python/3.6.0/python-3.6.0-embed-amd64.zip
Copy all the contents to the python folder which is registered in the environment.
I managed to fix all this Python cringe by doing this:
Download newest version of Python for your version after the first point. In this case it's Python 3.6, so I downloaded the latest available - 3.6.8:
https://www.python.org/downloads/release/python-368/
Run it.
Check the checkbox "Add Python to Path":
Press on the Custom Installation button:
Press Next:
Install:
It should install. Now go to Control Panel\Programs\Programs and Features, press RMB and uninstall:
Now run your wanted Python 3.6.X installation again.
If it still gives you the "A newer version of the Python launcher is already installed", run the latest installer again as in all the previous steps, but instead, check the "Install for All Users" checkbox:
Then uninstall this latest version again.
And then install your wanted Python 3.6.X installation again.
I'm throwing hands in the air, personally
I had to do it just now for 3.6, 3.7, 3.8, 3.9 and 3.10 versions because I had problems with uninstalling and installing with errors "no python installation was detected" and "A newer version of the Python launcher is already installed". Why do I have all these different versions of Python? Because different programs want different versions of Python installed and refuse to work with any other(lmao).
World would be a better place without Python.
For me, the solution to the problem (a newer version of the python launcher is already installed) was to install it via the web installer from the website (https://www.python.org/downloads/windows/)
Download the Windows x86-64 web installer. The installer took for his series (3.7). Oddly enough, it worked the first time. Previously, the registry was cleaned, and the removal of possible traces of the program - all to no avail.

Categories

Resources