-
Notifications
You must be signed in to change notification settings - Fork 44
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
conda-forge installation in win10 env? #14
Comments
For what it's worth it's quite easy to install by hand on Windows 10. The following steps work for me with Anaconda:
|
Hi, These commands worked well. and I run the last command, I got this error. Does anyone have an idea what would be the problem? |
It would probably be best to put in a PR to the pyembree-feedstock for building on windows |
This didn't work for me at first, but it worked once I made sure to clone pyembree into \Lib\site-packages\ of my environment. |
As I said, adding that to the feedstock would be awesome! |
I followed This instruction. Environment:
Finally, I successfully installed Pyembree. |
Still works in 2020, thank you |
I have the same problem, how do you fix that? |
I got the same issue, anyone could help? Thanks a lot! |
The issue has been solved, I got hint from this thread. |
Hi, how did you solve it? |
This didn't work for me either, I also made sure that Win 10 SDK is up to date. Does anyone know how to solve this issue? |
|
For me it worked. Follow the order,
|
Following @sasadara 's steps broke something in the environment. On |
Did you resolve it? |
No, but I could simply set up the environment from scratch. |
I was able to install this in the normal Conda PowerShell without any cloning or switching shells. You can set environmental variables like this in PowerShell and then compile/install (and I just hardcoded the full paths to avoid other problems):
Hope this is helpful to someone, I wasted about an hour on it :) |
@scopatz How do we put in a PR to the pyembree-feedstock for building on windows? Do I create a new issue at the conda-forge/anaconda-client-feedstock GitHub page? Let's get this going! Also, can we make add support for installing this via |
Installation InstructionsTested on:OS: Windows 10 x64 Professional, Build 1909 Steps
cd C:\vcpkg
git clone https://github.com/Microsoft/vcpkg.git
bootstrap-vcpkg.bat
vcpkg integrate install Alternatively, you can download and install the embree-2.17.7.x64.msi Installer on Embree's GitHub page (to learn more about Embree, visit their website).
vcpkg install embree2:x64-windows
py -m pip install numpy cython wheel setuptools pyvista pykdtree rtree trimesh
git clone https://github.com/scopatz/pyembree.git and remove the underlying
import os
from setuptools import find_packages, setup
import numpy as np
from Cython.Build import cythonize
from Cython.Distutils import build_ext
include_path = [
np.get_include(),
]
ext_modules = cythonize("pyembree/*.pyx", language_level=3, include_path=include_path)
for ext in ext_modules:
ext.include_dirs = include_path
ext.libraries = [
"pyembree/embree2/lib/embree",
"pyembree/embree2/lib/tbb",
"pyembree/embree2/lib/tbbmalloc",
]
setup(
name="pyembree",
version="0.1.6",
cmdclass={"build_ext": build_ext},
ext_modules=ext_modules,
zip_safe=False,
packages=find_packages(),
include_package_data=True,
package_data={"pyembree": ["*.cpp", "*.dll"]},
)
and dynamic libraries
# distutils: language=c++ and change every relative import of an cimport rtcore as rtc to cimport pyembree.rtcore as rtc
>>> import pyembree
>>> from pyembree import rtcore_scene
>>> If you get no errors, then
The
import numpy as np
from pykdtree.kdtree import KDTree
import pyvista as pv
from pyvista import examples
# Load data
data = examples.load_random_hills()
data.translate((10, 10, 10))
# Create triangular plane (vertices [10, 0, 0], [0, 10, 0], [0, 0, 10])
size = 10
vertices = np.array([[size, 0, 0], [0, size, 0], [0, 0, size]])
face = np.array([3, 0, 1, 2])
planes = pv.PolyData(vertices, face)
# Subdivide plane so we have multiple points to project to
planes = planes.subdivide(8)
# Get origins and normals
origins = planes.cell_centers().points
normals = planes.compute_normals(cell_normals=True, point_normals=False)["Normals"]
# Vectorized Ray trace
points, pt_inds, cell_inds = data.multi_ray_trace(
origins, normals
) # Must have rtree, trimesh, and pyembree installed
# Filter based on distance threshold, if desired (mimics VTK ray_trace behavior)
# threshold = 10 # Some threshold distance
# distances = np.linalg.norm(origins[inds] - points, ord=2, axis=1)
# inds = inds[distances <= threshold]
tree = KDTree(data.points.astype(np.double))
_, data_inds = tree.query(points)
elevations = data.point_arrays["Elevation"][data_inds]
# Mask points on planes
planes.cell_arrays["Elevation"] = np.zeros((planes.n_cells,))
planes.cell_arrays["Elevation"][pt_inds] = elevations
planes.set_active_scalars("Elevation") # Probably not necessary, but just in case
# Create axes
axis_length = 20
tip_length = 0.25 / axis_length * 3
tip_radius = 0.1 / axis_length * 3
shaft_radius = 0.05 / axis_length * 3
x_axis = pv.Arrow(
direction=(axis_length, 0, 0),
tip_length=tip_length,
tip_radius=tip_radius,
shaft_radius=shaft_radius,
scale="auto",
)
y_axis = pv.Arrow(
direction=(0, axis_length, 0),
tip_length=tip_length,
tip_radius=tip_radius,
shaft_radius=shaft_radius,
scale="auto",
)
z_axis = pv.Arrow(
direction=(0, 0, axis_length),
tip_length=tip_length,
tip_radius=tip_radius,
shaft_radius=shaft_radius,
scale="auto",
)
x_label = pv.PolyData([axis_length, 0, 0])
y_label = pv.PolyData([0, axis_length, 0])
z_label = pv.PolyData([0, 0, axis_length])
x_label.point_arrays["label"] = [
"x",
]
y_label.point_arrays["label"] = [
"y",
]
z_label.point_arrays["label"] = [
"z",
]
# Plot results
p = pv.Plotter()
p.add_mesh(x_axis, color="r")
p.add_point_labels(x_label, "label", show_points=False, font_size=24)
p.add_mesh(y_axis, color="r")
p.add_point_labels(y_label, "label", show_points=False, font_size=24)
p.add_mesh(z_axis, color="r")
p.add_point_labels(z_label, "label", show_points=False, font_size=24)
p.add_mesh(data)
p.add_mesh(planes)
p.show() |
I've opened a feature request on the pyembree-feedstock here |
Blood, sweat, and tears. |
I did:
I got error when import rtcore_scene
error message:
Environment: Conda, python3.9 |
@maycuatroi and @vinnik-dmitry07 Follow the instructions at the end of the post here on pyvista. These instructions are for Windows users to install without conda as pyembree only supports Mac and Linux via conda forge. |
That won't work. Follow the instructions I made that @vinnik-dmitry07 has shown. |
this works for me nicely, thank you! |
I don't recommend Anaconda, nor jupyter notebooks. While useful for personal use/teaching applications where the required libraries need static/shared lib's or DLL's, it's not conducive to building and distributing professional-level applications. Wherever possible, build the source yourself so you're not handcuffed to a 3rd-party vendor. |
Note in step 7 above that
Unfortunately (sort of), if you use Instead of turning code formatting off, you can do one of 2 things:
This solution assumes your sorter won't change in the future, but also that you are only importing from
from distutils.extension import Extension as _Extension
from setuptools import setup
distutils.extension.Extension = _Extension
distutils.command.build_ext.Extension = _Extension
Extension = _Extension
from Cython.Distutils import build_ext However, I don't think this is very bullet-proof. I've opened an issue with [BUG] |
For those interested, I've created a fork of this repo where I've implemented these fixes and added the required DLLs: https://github.com/adam-grant-hendry/pyembree It's not > py setup.py build_ext -i The only prerequisite (besides an Intel CPU) is that you have the Visual Studio Build Tools. Alternatively, I've placed the Windows Python 3.8 |
You can know |
Useful! |
Kind of works, but if I for example do |
I got it to install by:
There unfortunately no longer seems to be an embree2 package available in vcpkg. I appreciate the work maintaining pyembree, I never would have got it to install without that work! |
Hey all, my apologies. I've been MIA for nearly 4 months on several other work projects. I've been wanting to upgrade this fork to add Python 3.9-3.11 (if possible) and also to add embree3. I've just been swamped with the day job. Someone's already opened up a PR to add support for Python other than 3.8, but some tests were failing. I wanted to revamp that. I might just go ahead and make a separate package altogether that supports embree 2 and 3, but just give it a different name. Again, all things I desperately want to do, I've just completely run out of time (even to look at other's PRs). Thanks in advance for your patience. |
Noted here that I could not get 'from pyembree import rtcore_scene' to successfully pass in a Miniconda environment running Python 3.8.10. (I used the pip install pyembree as suggested). I get: ImportError: DLL load failed while importing rtcore_scene: The specified module could not be found. I did get it to work using iPython as well as a python distribution from a native 3.8.10. (https://www.python.org/downloads/release/python-3810/) Any idea why Miniconda fails? I am in a Windows 10 Env. |
For this method, I found that this works with specific versions of libraries. |
Hi
I am wondering that does the installation available in win10 x64 environment?
some logs:
The text was updated successfully, but these errors were encountered: