Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

installation errors #18

Open
SND8041 opened this issue Jun 19, 2018 · 7 comments
Open

installation errors #18

SND8041 opened this issue Jun 19, 2018 · 7 comments

Comments

@SND8041
Copy link

SND8041 commented Jun 19, 2018

Hi,
I have python27 installed on Windows 10, the packages: networkx, scipy, numpy and all that are required are installed already. Trying the following command, after downloading pracmln in a folder, say C:\pracmln:

C:\pracmln>python setup.py install
Traceback (most recent call last):
File "setup.py", line 7, in
pip.main(['install', 'appdirs'])
AttributeError: 'module' object has no attribute 'main'

Then I used pip:

C:\pracmln>pip install pracmln
Collecting pracmln
Using cached https://files.pythonhosted.org/packages/79/c8/757ecbf41fd85a942c9c1fe3d6087b845969a70ef95f23cca1bb746e861c/pracmln-1.2.3.tar.gz
Complete output from command python setup.py egg_info:
Traceback (most recent call last):
File "", line 1, in
File "c:\users!snd804\appdata\local\temp\pip-install-_ftvu1\pracmln\setup.py", line 7, in
pip.main(['install', 'appdirs'])
AttributeError: 'module' object has no attribute 'main'

----------------------------------------

Command "python setup.py egg_info" failed with error code 1 in c:\users!snd804\appdata\local\temp\pip-install-_ftvu1\pracmln\

What am I missing? Can you guide?

Thanks

Syed

@kaivalyar
Copy link
Collaborator

Please check your version of pip. I have no idea about Windows, but on my computer:

... $ pip -V
pip 10.0.1 from /home/ ... /python2.7/site-packages/pip (python 2.7)

If your version of pip is 10, then please note that pip doesn't support main anymore. A quick fix is to downgrade your pip version to 9.0.3 (See here for details, here for solution)

To do this, execute the following command (or it's Windows equivalent)

$ python -m pip install --upgrade pip==9.0.3
Collecting pip==9.0.3
.
.
.
Successfully installed pip-9.0.3
**You are using pip version 9.0.3, however version 10.0.1 is available.
You should consider upgrading via the 'pip install --upgrade pip' command.**

Ignore the warning at the end.

To ensure that this will work, the pip version check must tell you that pip has been rolled back to 9.0.3:

$ pip -V
pip 9.0.3 from /home/ ... /python2.7/site-packages (python 2.7)

Now you can proceed to install PracMLN and its requirements.
Hope this helps!

@SND8041
Copy link
Author

SND8041 commented Jun 20, 2018

Hello,

Thanks for your reply. Following your suggestions I uninstalled the pip version 10 and installed the one you mentioned. Then I installed PracMLN, everything went good during the installation but when I ran the command C:\Python27\mlnlearn I received the following message:

C:\Python27>mlnlearn
Traceback (most recent call last):
File "c:\python27\lib\runpy.py", line 174, in run_module_as_main
"main", fname, loader, pkg_name)
File "c:\python27\lib\runpy.py", line 72, in run_code
exec code in run_globals
File "C:\Python27\Scripts\mlnlearn.exe_main
.py", line 5, in
File "c:\python27\lib\site-packages\pracmln_init
.py", line 21, in
from mln.base import MLN
File "c:\python27\lib\site-packages\pracmln\mln_init_.py", line 27, in
from base import MLN
File "c:\python27\lib\site-packages\pracmln\mln\base.py", line 27, in
from dnutils import logs, ifnone, out
File "c:\python27\lib\site-packages\dnutils_init_.py", line 10, in
from .signals import add_handler, rm_handler, enable_ctrlc
File "c:\python27\lib\site-packages\dnutils\signals.py", line 11, in
SIGKILL = signal_.SIGKILL
AttributeError: 'module' object has no attribute 'SIGKILL'

I am new in Python, and MLN so please accept my apologies for asking a kind of a silly nontechnical question.

Syed

@kaivalyar
Copy link
Collaborator

Hi Syed,

There are no silly questions.

Looks like your setup was successful. If I understand correctly, your issue is the same as #13. This is a Windows-specific error, and unfortunately I am not aware of any solution yet. It looks like dnutils is actually not cross-platform, and doesn't work on Windows. However, I am unsure if this is really the case, since I can't find it being reported elsewhere on the internet.

Unfortunately I don't use Windows myself, and can thus offer very little by way of advice, but there must be some possible workaround that you could discover.

@tpacker
Copy link

tpacker commented Feb 6, 2019

I'm getting a similar attribute error when I try to import pracmln in a Jupyter notebook on a MacBook Pro.


AttributeError Traceback (most recent call last)
in
----> 1 import pracmln

~/anaconda3/envs/mln/lib/python3.6/site-packages/pracmln/init.py in
20 # TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
21 # SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
---> 22 from .mln.base import MLN
23 from .mln.database import Database
24 from .mln.constants import *

~/anaconda3/envs/mln/lib/python3.6/site-packages/pracmln/mln/init.py in
25 # SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
26
---> 27 from .base import MLN
28 from .base import HARD
29 from .base import Predicate

~/anaconda3/envs/mln/lib/python3.6/site-packages/pracmln/mln/base.py in
25 # SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
26 import pyparsing
---> 27 from dnutils import logs, ifnone, out
28
29 from ..logic import FirstOrderLogic, FuzzyLogic

~/anaconda3/envs/mln/lib/python3.6/site-packages/dnutils/init.py in
5 from .debug import out, stop, trace, stoptrace
6 from .tools import ifnone, ifnot, allnone, allnot, edict, idxif, first, last, LinearScale
----> 7 from .signals import add_handler, rm_handler, enable_ctrlc
8 from .threads import Lock, RLock, Condition, Event, Semaphore, BoundedSemaphore, Barrier, Relay, Thread,
9 SuspendableThread, sleep, waitabout, Timer

~/anaconda3/envs/mln/lib/python3.6/site-packages/dnutils/signals.py in
14 SIGBUS = signal_.SIGBUS
15 SIGCHLD = signal_.SIGCHLD
---> 16 SIGCLD = signal_.SIGCLD
17 SIGCONT = signal_.SIGCONT
18 SIGFPE = signal_.SIGFPE

AttributeError: module 'signal' has no attribute 'SIGCLD'

@SND8041
Copy link
Author

SND8041 commented Feb 6, 2019 via email

@tpacker
Copy link

tpacker commented Feb 7, 2019

I'm on a Mac. I cannot seem to get it to work.

I see that ProbCog has examples for running inference from Python. I can run ProbCog okay for the most part on my Mac.

What is the relationship between PracMLN and ProbCog? Does PracMLN simply provide a python package wrapper for ProbCog? Is ProbCog being maintained actively?

@laurendelong21
Copy link

laurendelong21 commented Jul 5, 2023

Also on a Macbook, can not get it to work

` 1 # -- coding: utf-8 --
2 #
3 # Markov Logic Networks
(...)
24 # TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
25 # SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
---> 27 from .base import MLN
28 from .base import HARD
...
---> 25 SIGCLD = signal_.SIGCLD
26 SIGCONT = signal_.SIGCONT
27 SIGFPE = signal_.SIGFPE

AttributeError: module 'signal' has no attribute 'SIGCLD'`

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants