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

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.

Related

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

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

Test Anaconda build after updating packages

I use conda update --all to update my packages. Recently, I encountered an error with Anaconda build, posted at Error while trying to update and use scipy module in Anaconda. It seems now the issue has been fixed. Is there any way, I can test all modules one by one by importing them and deleting them ? I am requesting this because I have noticed that if import doesn't work, I spend a lot of time figuring out the dependency and then the package that is causing this. For instance, a few minutes ago I found that PyCharm 2018.2.4 breaks with the latest version of matplotlib (3.0.0). Hence, it might be helpful to run some type of test script after running conda update --all to ensure that all packages are indeed working--i.e. importable.
I did some research on this topic and found three sources.
First, Anaconda offers run_test.py (Source: https://conda.io/docs/user-guide/tasks/build-packages/recipe.html). However, being new to the world of Python, I am unsure how to go about running a script in Anaconda terminal.
Second, I found: https://conda.io/docs/user-guide/install/test-installation.html. However, this just tells me the version of the package. I am not interested in the version. I need to know whether all packages import properly.
Finally, I found out that there is a method to run test script for all packages at https://anaconda-installer.readthedocs.io/en/latest/testing.html. However, I am unsure how I can run make in Anaconda terminal. I used to use make long time ago when I worked on gcc on Unix environment. Being new to Python, I am unsure how to go about handling this.
I'd appreciate any thoughts or any test script that could help us verify two things:
a) whether all packages have been installed
b) packages are indeed importable; If the package import fails, the script should terminate with handsome error message highlighting the source (package) where import failed.

Python: Custom package installation not importing module

I'm having a problem with this package that I installed in Python 3.5. After installing it, I try to run requestProxy.py but it won't import any of its own packages. Here's what I did, and what's happening.
I cloned it and created a private repo using these instructions.
I installed in an activated virtualenv, created without using sudo, using:
pip3 install -e HTTP_Proxy_Randomizer
Terminal said it installed ok.
I can find the egg link in my virtualenv's site-packages folder, but when I try to run the main file, it says:
from project.http.requests.parsers.freeproxyParser import freeproxyParser
ImportError: No module named project.http.requests.parsers.freeproxyParser
I had to write a setup.py for the package, which didn't seem to come with its own. I came up with:
setup(name='HTTP_Request_Randomizer',
version='1.0',
description='HTTP Proxy Request Randomizer',
package_dir={'project': 'project','http':'project/http',\
'requests':'project/http/requests','errors':'project/http/requests/errors',\
'parsers':'project/http/requests/parsers','proxy':'project/http/requests/proxy'},
packages=['project','http','requests','errors','parsers','proxy']
Here's the package structure:
pip3 freeze
gives me:
Complete output from command git config --get-regexp remote\..*\.url:
fatal: bad config file line 4 in /home/danny/.gitconfig
----------------------------------------
Error when trying to get requirement for VCS system Command "git config --get-regexp remote\..*\.url" failed with error code 128 in /home/danny/Documents/HTTP_Request_Randomizer, falling back to uneditable format
Could not determine repository location of /home/danny/Documents/HTTP_Request_Randomizer
Django==1.9.7
## !! Could not determine repository location
HTTP-Request-Randomizer==1.0
mysqlclient==1.3.7
So I want to have requestProxy.py install the other necessary packages and not fail at line 1. I'm sure this is a problem with my implementation and not the original author's coding. I was experimenting with this package a couple of weeks ago before I was aware of virtualenvs or pip install -e, and just copied it manually to site-packages. It worked then. Now I understand the concepts to do it more cleanly, but I can't get those to work.
It feels as though I have done something wrong with my git config or with my package_dir structure in setup.py, perhaps?
I've been pythoning for maybe a month and have a lot to learn. I normally find what I need on Stack Overflow without having to bother anyone, but after trying everything with this, I really need some help. Any advice much appreciated.
I figured it out. I was using Ninja IDE, and even though I entered the virtualenv for the project and restarted, it still wasn't recognizing it. I was able to run it from the terminal, and also in Pycharm and Liclipse.

Trouble installing JCC (required for pylucene) on mac

I am following closely the installation guide for pylucene. I am unable to get past the first step, which requires installing JCC.
To install JCC the instructions briefly note that mac users will need to:
Edit setup.py and review that values in the INCLUDES, CFLAGS,
DEBUG_CFLAGS, LFLAGS and JAVAC are correct for your system. These
values are also going to be compiled into JCC's config.py file and are
going to be used by JCC when invoking distutils or setuptools to
compile extensions it is generating code for.
I am not sure what exactly to edit. I have Java 1.6 installed. When I run the setup.py (without any edits), it gives me the error (which I expect because I haven't edited anything, as instructed):
Can't determine where the Java JDK has been installed on this machine. Please set the environment variable JCC_JDK to that location
before running setup.py.
I am a novice coder, so am having trouble finding what I should edit in the setup.py to make this work on a mac? I have tried putting in the file path to java, but this has not helped. Any advice would be much appreciated, thanks!

Buildbot Installation Setup Error

So I tried to install buildbot onto a OS X machine, and was unable to install it through the setup.py file. When I tried to run: sudo python setup.py build, it returned this:
error in buildbot setup command: 'install_requires' must be a string or list of strings
containing valid project/version requirement specifiers
I was wondering what I could do to fix this. I have buildbot installed on a machine running ubuntu right now, but cannot seem to install it on the OS X machine.
EDIT: here's a link to setup.py: https://github.com/buildbot/buildbot/blob/master/master/setup.py
EDIT #2: Fixed the initial problem, but now when I run either python setup.py build or python setup.py install I keep getting an error:
error: package directory buildbot/buildslave does not exist
Why not just use easy_install?
sudo easy_install buildbot
EDIT: To fix the problem initially, without having to do all of these steps, simply change the line specifying the version of sqlalchemy (under setup_args['install_requires'] go to sqlalchemy >= 0.6 and change it to sqlalchemy == 0.7.10)
Fixed the initial problem by just copy pasting their newest code from github (the link I posted above). However, it seems by doing just that, I included extra directories in the setup that weren't part of this version (i.e. buildbot.slave etc.). To fix that, I just copied the list labeled 'packages' from the original version of the setup.py, thus fixing the problem.
'packages': ["buildbot",
"buildbot.status", "buildbot.status.web","buildbot.status.web.hooks",
"buildbot.changes",
"buildbot.steps",
"buildbot.steps.package",
"buildbot.steps.package.deb",
"buildbot.steps.package.rpm",
"buildbot.steps.source",
"buildbot.process",
"buildbot.process.users",
"buildbot.clients",
"buildbot.monkeypatches",
"buildbot.schedulers",
"buildbot.scripts",
"buildbot.db",
"buildbot.db.migrate.versions",
"buildbot.util",
"buildbot.test",
"buildbot.test.fake",
"buildbot.test.unit",
"buildbot.test.util",
"buildbot.test.regressions",
],

Categories

Resources