No user name & "User name mismatch" error
AnsweredWhen I use gurobipy and Model constructor, there is an error which tells me that there is no my user name.
(I'll describe the error and my input strings in ipython.)
How should I do to use gurobipy?
---
In [1]: from gurobipy import Model
In [2]: Model()
Using license file /home/cl/takayoshi-s/.local/share/gurobi/gurobi.lic
---------------------------------------------------------------------------
GurobiError Traceback (most recent call last)
<ipython-input-2-116322b4e2da> in <module>
----> 1 Model()
model.pxi in gurobipy.Model.__init__()
gurobi.pxi in gurobipy.gurobi._getdefaultenv()
env.pxi in gurobipy.Env.__init__()
GurobiError: User name mismatch (licensed to 'takayoshi-s', current user is '')
-
Hi,
Your user name is not detected. What operating system are you using? It looks like a Linux/UNIX but what's uncommon is that your home directory is in another subdirectory "cl". Can you please run "whoami" and "uname -a" and post the results here?
Thanks,
Matthias0 -
Thank you for the fast reply.
I'm running on Ubuntu 16.04.6 LTS (GNU/Linux 4.4.0-165-generic x86_64).
Yes, my home directory is "/home/cl/takayoshi-s".
(Subdirectories under "/home" is shared between multiple servers by NFS.)
---- Result of "whoami" and "uname -a" -----
takayoshi-s@pine42:~$ whoami
takayoshi-s
takayoshi-s@pine42:~$ uname -a
Linux pine42.naist.jp 4.4.0-165-generic #193-Ubuntu SMP Tue Sep 17 17:42:52 UTC 2019 x86_64 x86_64 x86_64 GNU/Linux
---------
Takayoshi Shibahara
0 -
Hi Takayoshi,
This is all looking fine so far. Can you please post the output of grbprobe as well?
Thanks,
Matthias0 -
Hi Matthias,
This is the output of grbprobe.
----
takayoshi-s@pine42:~/venv/GiNZA/bin$ grbprobe
info : grbprobe version 9.0.0, build v9.0.0rc2
HOSTNAME=pine42.naist.jp
HOSTID=e08e4ce7
PLATFORM=linux64
USERNAME=takayoshi-s
SOCKETS=2
CORES=36
CPU=Intel(R) Xeon(R) CPU E5-2699 v3 @ 2.30GHz
----
Thanks,
Takayoshi
0 -
Can you successfully run "gurobi_cl --license"?
Cheers,
Matthias0 -
At first, there is a problem with running "gurobi_cl --license", so I run "chmod +x" for licence file.
Then, the problem is solved.
After that, I reinstalled gurobipy for a new python virtual environment.
However, the same problem(No user name & "User name mismatch" error) occurred again.
----output of "gurobi_cl --license"---
(tax-org) takayoshi-s@pine42:~$ gurobi_cl --license
Failed to setup a license
ERROR 10012: Unable to open Gurobi license file '/home/cl/takayoshi-s/.local/share/gurobi/pine42/gurobi.lic'
(tax-org) takayoshi-s@pine42:~$ ls -l .local/share/gurobi/pine42/gurobi.lic
-rw-r--r-- 1 takayoshi-s is-student 207 Nov 28 18:51 .local/share/gurobi/pine42/gurobi.lic
(tax-org) takayoshi-s@pine42:~$ chmod +r .local/share/gurobi/pine42/gurobi.lic
(tax-org) takayoshi-s@pine42:~$ gurobi_cl --license
Using license file /home/cl/takayoshi-s/.local/share/gurobi/pine42/gurobi.lic
Set parameter LogFile to value gurobi.log
Academic license - for non-commercial use only----
Thank you for your many responses.
Takayoshi
0 -
Hi Takayoshi -
Can you try running whoami and uname -a from within your Jupyter notebook?
! whoami
! uname -aThanks, Gwyneth
0 -
Hi Gwyneth, thank you for your advice.
I tried both commands on Jupyter and IPython.
-----
On Jupyter-Notebook
! uname -a
Linux pine42.naist.jp 4.4.0-165-generic #193-Ubuntu SMP Tue Sep 17 17:42:52 UTC 2019 x86_64 x86_64 x86_64 GNU/Linux
! whoami
takayoshi-sOn IPython
In [1]: ! whoami
takayoshi-sIn [2]: ! uname -a
Linux pine42.naist.jp 4.4.0-165-generic #193-Ubuntu SMP Tue Sep 17 17:42:52 UTC 2019 x86_64 x86_64 x86_64 GNU/Linux----
Thanks,
Takayoshi
0 -
Thanks for all the details, we will handle your issue inside a regular support request.
Best regards,
Sonja
0 -
I had the same issue on my machine, which was solved by changing my locale setting (i.e., LANG and LC_* environment variables); in particular, `export LC_ALL=C` fixed the issue and gurobi detected my username.
1 -
Hey I might have the same issue,
I do have an academic license and I get the following error when executing my model:Set parameter Username
Error code: 10009. User name mismatch (licensed to 'florian', current user is '')When I execute
whoami
the result is
florian
Runninggrbprobe
results in
info : grbprobe version 10.0.1, build v10.0.1rc0
PLATFORM=mac64
USERNAME=
CPU=Apple M1
[...other infos]gurobi_cl --license
returns
Set parameter Username
Set parameter LogFile to value "gurobi.log"Failed to set up a license
Error 10009: User name mismatch (licensed to 'florian', current user is '')
How can I set the username correctly to be recognized by grbprobe and gurobi_cl?
0 -
Hi Florian!
Did you try changing the LC_ALL environment variable?
export LC_ALL=C
Cheers,
Matthias1 -
Thanks for your quick response Matthias!
export LC_ALL=C
worked for me! For all IntelliJ Users: you might have to define the LC_ALL variable within the run configuration.
I'm sorry for the circumstances, I only double-checked that the code accesses the correct username but did not double-check the LC_ALL value.0 -
I have the same problem, but I use windows. I'd be glad if any help can be provided.
1
Please sign in to leave a comment.
Comments
14 comments