Install npm packages in Python virtualenv
<p>There are some npm packages which I would like to install in a Python virtualenv. For example: </p>

<ul>
<li><a href="https://www.npmjs.com/package/pdfjs-dist" rel="nofollow">https://www.npmjs.com/package/pdfjs-dist</a></li>
<li><a href="https://www.npmjs.com/package/jquery-ui" rel="nofollow">https://www.npmjs.com/package/jquery-ui</a></li>
</ul>

<p>Up to now I only found the complicated way to get these installable in a virtualenv: Create a python package for them.</p>

<p>Is there no simpler way to get npm packages installed in a Python virtualenv?</p>

<p>NPM and pip have nothing to do with each other, so you won't be able to install NPM packages inside a virtualenv.</p>

<p>However: <a href="https://docs.npmjs.com/files/folders" rel="nofollow">NPM installs packages in <code>./node_modules</code></a>.</p>

<p>So if you created a virtualenv and installed npm modules inside it</p>

<pre><code>virtualenv myproj
cd myproj
source bin/activate
npm install pdfjs-dist jquery-ui
</code></pre>

<p>you will end up with the node packages in <code>myproj/node_modules</code>, which is as close as it gets to "installing NPM inside virtualenv".</p>

python npm installation pip