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

Difficulties in installing the 3dm Import Module #1

Closed
dshguilherme opened this issue Jan 14, 2019 · 14 comments
Closed

Difficulties in installing the 3dm Import Module #1

dshguilherme opened this issue Jan 14, 2019 · 14 comments
Assignees
Labels
bug Something isn't working

Comments

@dshguilherme
Copy link

Describe the bug
CMake 3.13.2 gives out Error when following the Installing procedure.

To Reproduce
Steps to reproduce the behavior:

  1. Downloaded the repository to a local file, under a custom name
  2. Updated the submodules using Git Bash
  3. CMake gives out Error: "Error in configuration process, project files may be invalid"
    image
@orbingol
Copy link
Owner

@dshguilherme could you please post the CMake logs too?

@dshguilherme
Copy link
Author

Log only says:
image

@orbingol
Copy link
Owner

orbingol commented Jan 14, 2019

Could you also post the logs in the CMake GUI too? I can only see "Configuring incomplete" part on the screenshot.

I have also some preliminary guesses for the solution:

  1. Please make sure that you have CMakeLists.txt file in the C:/Doutorado directory? (I see the directory name on the screenshot)
  2. Sometimes it is possible to get permission errors when you try to create a build directory on your Windows desktop using a non-Microsoft application. The best solution is choosing some other directory outside your Desktop or Documents. Definitely there is a fix for that but I don't remember it right now (sorry). I usually create the build directory inside the cloned repo directory. That directory is ignored using .gitignore.
  3. Please make sure that you picked "Visual Studio 2017 64-bit" from the list of compilers. CMake can be a little bit confusing on that.

@dshguilherme
Copy link
Author

After tweaking a lot with CMake (I was missing some key Visual Basic packages), I'm currently now stuck with CMake/Python problems. Namely this:
image
Uploading Output Log:
CMakeOutput.log

@orbingol
Copy link
Owner

orbingol commented Jan 15, 2019

It seems pybind11 isn't able to detect a cpython interpreter: https://github.com/pybind/pybind11/blob/9a19306fbf30642ca331d0ec88e7da54a96860f9/tools/FindPythonLibsNew.cmake#L96

Additionally, it seems a decent problem though: pybind/pybind11#236

I will see what I can do (however, I don't think I can do anything to fix a pybind11 issue) but in the meantime, you can try the following super simple solutions. Please note that these super simple solutions don't mean they are correct:

Solution 1:

  • Add Python and Python\scripts directories to the system path
  • Open a command prompt or powershell instance
  • Write "python" and then "pip"
  • If you are not getting file not found errors, then you are good. Otherwise, check system path.
  • Restart CMake, clean CMake variables
  • Rerun CMake

Solution 2:

@dshguilherme
Copy link
Author

Solution 1 worked and make CMake run! Great. Now to work on those Rhino -> NURBS-Python... :)

Thanks a lot!

@orbingol
Copy link
Owner

It is good to know that you figured it out :)

@dshguilherme
Copy link
Author

Now, after installing it, I get AttributeError: module 'rw3dm' has no attribute 'read'.
So I tried opening the module and to my surprise it is a bunch of nonsense.
image
I'm starting to think that the best way is to scan points over my geometry and interpolate them...

@orbingol
Copy link
Owner

That's a binary file actually :) and it looks like a Python egg file, i.e. a zipped module. It should work fine, though.

By looking at the error, I suspect that you might be using a different python version than you compiled the module for. That also happens when you compile the Python module with Debug option selected in Visual Studio. Please try to compile it with Release option selected.

@orbingol orbingol reopened this Jan 15, 2019
@orbingol orbingol added the bug Something isn't working label Jan 15, 2019
@orbingol orbingol self-assigned this Jan 15, 2019
@orbingol
Copy link
Owner

I am reopening this issue as I have found a problem in generation of Python wheel files and fixed it with the release of v1.1.0. I have also added the ability to call from rw3dm import * import statement (after the installation of course).

@dshguilherme could you please check it again with the latest updates?

@dshguilherme
Copy link
Author

When running setup.py it gives errors:
image

@orbingol
Copy link
Owner

orbingol commented Jan 16, 2019

What I see from the screenshot is that

  1. You are using Debug version. Have you installed or really intended to use Python's debug version? If so, you might not be aware that you will end up compiling pretty much every single module you want to use. Please choose Release from the drop-down menu in VS2017 before starting to compile the module (I guess you missed it here: Difficulties in installing the 3dm Import Module #1 (comment))
  2. Although the first solution should solve everything, it is always recommended to delete CMake build folder if you are constantly getting errors. This could be considered as the first rule of debugging with CMake.

I haven't added any information to choose Release version as some people might actually want to debug the module to add more features. Python's debug and regular versions are different, different module names and even different interpreters and it is possible to debug CPython modules with Visual Studio (and gdb, if you would like to accept the challenge :))

In any case, python setup.py develop or its pip counterpart should also work fine but you shouldn't delete the module installation directory.

@dshguilherme
Copy link
Author

I have select the Release in VS2017 now, and went through with the installation. Still, rw3dm doesn't seem to have any methods, as per the picture.
image

@dshguilherme
Copy link
Author

FIXED. Apparently I was missing the "from rw3dm import rw3dm". Not it finally works!

Thanks for being patient and helping me along this :) I'll surely cite rw3dm and NURBS-Python on my publications and properly thank you in the works.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants