Hi Richard,

I use rdkit with Miniconda and PyCharm as you do. Which makes things easier
as far for autocomplete in the IDE.
But I do not use PyCharm's Python console for that same reason, instead I
have a cmd window with my Python environment activated to run tests.

Greg's proposed solution for a script I think is the best approach for
having different Python environments activated along with additional
instances of PyCharm.

Regards,

Christos

Christos Kannas

Researcher
Ph.D Student

[image: View Christos Kannas's profile on LinkedIn]
<http://cy.linkedin.com/in/christoskannas>

On 31 May 2017 at 09:56, Greg Landrum <greg.land...@gmail.com> wrote:

> Hi Richard,
>
> I'm glad you found something that works. I'm not enough of a Windows
> expert to be able to provide an example of how to fix it, but here's what
> you need to do:
>
> When you activate a conda environment a bunch of stuff happens behind the
> scenes, it's not generally sufficient to just call the corresponding
> interpreter directly (as you've seen). So you really need to activate the
> environment before invoking PyCharm. I would guess that the easiest way to
> do this is to create a batch file that first does the environment execution
> and then invokes PyCharm. That way you only have one command that you need
> to execute.
>
> A more "fixing the problem with a big hammer" solution, and probably not
> something that would be recommended, would be to install the rdkit into the
> root conda environment (i.e. do `conda install -c rdkit rdkit` without
> activating an environment first. This should allow things to work directly.
>
> -greg
>
>
>
> On Tue, May 30, 2017 at 10:10 PM, West, Richard <r.w...@northeastern.edu>
> wrote:
>
>> We're having trouble getting RDKit to work in a PyCharm project using an
>> Anaconda interpreter (Python 2.7), on Windows 8.1.
>> Has anyone had success with this and can guide us?
>> The trouble is we get an
>>
>>   ImportError: DLL load failed: The specified module could not be found.
>>
>> when trying to import rdkit (or rdBase).
>>
>> We have tried many variations of the following, but here is a basic
>> recipe of what does/doesn't work:
>> 1. Make a new conda environment (called 'eg1'), install rdkit ('conda
>> install -c rdkit rdkit')
>> 2. From a cmd.exe prompt, use this environment ('activate eg1') load
>> python ('python') and import rdkit ('import rdkit') it works fine.
>> 3. From PyCharm, create a Project Interpreter (pointing to
>> 'C:\Anaconda2\envs\eg1\python.exe'), and use this to run a script or
>> create a new Python Console in which you 'import rdkit', leading to the
>> "DLL load failed" message.
>> 4. We have tried manually adding a bunch of things to the "Interpreter
>> Paths" in PyCharm, but without success (perhaps we just didn't add the
>> right thing).
>>
>>
>> ----
>>
>> Update: just before I hit "send" on this request for help, we stumbled
>> across this posting of the same problem, and solution, from Christian
>> Ribeaud:
>> https://intellij-support.jetbrains.com/hc/en-us/community/
>> posts/115000244450-DLL-load-failed
>>
>> It seems that if we open cmd.exe, activate the environment, and then
>> launch PyCharm exe from there, it works.
>> I'm sharing this here because it took us a while to find the other post,
>> but also to ask: is there a "better" way?
>>
>> Cheers,
>> Richard
>>
>>
>> --
>> Richard H. West, Ph.D.
>> Assistant Professor, Department of Chemical Engineering,
>> Northeastern University, 360 Huntington Ave, Boston, MA 02115
>> http://northeastern.edu/comocheng    Phone: 617-373-5163
>>
>>
>> ------------------------------------------------------------
>> ------------------
>> Check out the vibrant tech community on one of the world's most
>> engaging tech sites, Slashdot.org! http://sdm.link/slashdot
>> _______________________________________________
>> Rdkit-discuss mailing list
>> Rdkit-discuss@lists.sourceforge.net
>> https://lists.sourceforge.net/lists/listinfo/rdkit-discuss
>>
>
>
> ------------------------------------------------------------
> ------------------
> Check out the vibrant tech community on one of the world's most
> engaging tech sites, Slashdot.org! http://sdm.link/slashdot
> _______________________________________________
> Rdkit-discuss mailing list
> Rdkit-discuss@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/rdkit-discuss
>
>
------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
Rdkit-discuss mailing list
Rdkit-discuss@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/rdkit-discuss

Reply via email to